git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5840e15
)
AcessNative - Fix compile errors from API changes (and from compiler upgrade)
author
John Hodge (sonata)
<
[email protected]
>
Wed, 5 Nov 2014 02:14:08 +0000
(10:14 +0800)
committer
John Hodge (sonata)
<
[email protected]
>
Wed, 5 Nov 2014 02:14:08 +0000
(10:14 +0800)
12 files changed:
AcessNative/acesskernel_src/Makefile
patch
|
blob
|
history
AcessNative/acesskernel_src/main.c
patch
|
blob
|
history
AcessNative/acesskernel_src/net_wrap.c
patch
|
blob
|
history
AcessNative/acesskernel_src/server.c
patch
|
blob
|
history
AcessNative/acesskernel_src/threads.c
patch
|
blob
|
history
AcessNative/acesskernel_src/threads_glue.c
patch
|
blob
|
history
AcessNative/acesskernel_src/vfs_handle.c
patch
|
blob
|
history
AcessNative/ld-acess_src/binary.c
patch
|
blob
|
history
AcessNative/ld-acess_src/common.h
patch
|
blob
|
history
AcessNative/ld-acess_src/elf_load.c
patch
|
blob
|
history
AcessNative/ld-acess_src/memory.c
patch
|
blob
|
history
AcessNative/ld-acess_src/request.c
patch
|
blob
|
history
diff --git
a/AcessNative/acesskernel_src/Makefile
b/AcessNative/acesskernel_src/Makefile
index
9e8ce35
..
d2a22c6
100644
(file)
--- a/
AcessNative/acesskernel_src/Makefile
+++ b/
AcessNative/acesskernel_src/Makefile
@@
-15,7
+15,7
@@
KERNEL_SRC = ../../KernelLand/Kernel/
LDACESS_SRC = ../../Usermode/Libraries/ld-acess.so_src/
\r
\r
# - Kernel objects (from KernelLand/Kernel)
\r
LDACESS_SRC = ../../Usermode/Libraries/ld-acess.so_src/
\r
\r
# - Kernel objects (from KernelLand/Kernel)
\r
-KERNEL_OBJ := logging.o adt.o lib.o debug.o messages.o drvutil_disk.o drvutil_video.o
\r
+KERNEL_OBJ := logging.o adt.o lib.o debug.o messages.o drvutil_disk.o drvutil_video.o
memfs_helpers.o
\r
KERNEL_OBJ += mutex.o semaphore.o rwlock.o workqueue.o events.o
\r
#KERNEL_OBJ += libc.o
\r
KERNEL_OBJ += vfs/main.o vfs/open.o vfs/acls.o vfs/io.o vfs/dir.o
\r
KERNEL_OBJ += mutex.o semaphore.o rwlock.o workqueue.o events.o
\r
#KERNEL_OBJ += libc.o
\r
KERNEL_OBJ += vfs/main.o vfs/open.o vfs/acls.o vfs/io.o vfs/dir.o
\r
diff --git
a/AcessNative/acesskernel_src/main.c
b/AcessNative/acesskernel_src/main.c
index
ead4f33
..
9ef49c9
100644
(file)
--- a/
AcessNative/acesskernel_src/main.c
+++ b/
AcessNative/acesskernel_src/main.c
@@
-13,6
+13,7
@@
#endif
#include <unistd.h>
#include <string.h>
#endif
#include <unistd.h>
#include <string.h>
+#include <stdbool.h>
#include "../../KernelLand/Kernel/include/logdebug.h"
#define VALGRIND_CLIENT 0
#include "../../KernelLand/Kernel/include/logdebug.h"
#define VALGRIND_CLIENT 0
diff --git
a/AcessNative/acesskernel_src/net_wrap.c
b/AcessNative/acesskernel_src/net_wrap.c
index
730eda0
..
33a5cf9
100644
(file)
--- a/
AcessNative/acesskernel_src/net_wrap.c
+++ b/
AcessNative/acesskernel_src/net_wrap.c
@@
-8,6
+8,7
@@
#define DEBUG 1
#include <stdlib.h>
#include <unistd.h>
#define DEBUG 1
#include <stdlib.h>
#include <unistd.h>
+#include <stdbool.h>
#include "../../KernelLand/Kernel/include/logdebug.h"
#include "net_wrap.h"
#include <string.h>
#include "../../KernelLand/Kernel/include/logdebug.h"
#include "net_wrap.h"
#include <string.h>
diff --git
a/AcessNative/acesskernel_src/server.c
b/AcessNative/acesskernel_src/server.c
index
f3826db
..
8de8ad3
100644
(file)
--- a/
AcessNative/acesskernel_src/server.c
+++ b/
AcessNative/acesskernel_src/server.c
@@
-6,6
+6,7
@@
*/
#include <stdio.h>
#include <stdlib.h>
*/
#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <string.h>
#include <SDL/SDL.h>
#ifdef __WIN32__
#include <string.h>
#include <SDL/SDL.h>
#ifdef __WIN32__
diff --git
a/AcessNative/acesskernel_src/threads.c
b/AcessNative/acesskernel_src/threads.c
index
86b8a89
..
74d85fc
100644
(file)
--- a/
AcessNative/acesskernel_src/threads.c
+++ b/
AcessNative/acesskernel_src/threads.c
@@
-199,9
+199,10
@@
int Threads_SetGID(tGID NewGID)
}
int *Threads_GetErrno(void) { return &gpCurrentThread->_errno; }
}
int *Threads_GetErrno(void) { return &gpCurrentThread->_errno; }
-char **Threads_GetCWD(void) { return &gpCurrentThread->Process->CWD; }
-char **Threads_GetChroot(void) { return &gpCurrentThread->Process->Chroot; }
-int *Threads_GetMaxFD(void) { return &gpCurrentThread->Process->MaxFD; };
+static tProcess *proc(tProcess *Proc) { return Proc ? Proc : gpCurrentThread->Process; }
+char **Threads_GetCWD (tProcess *Proc) { return &proc(Proc)->CWD; }
+char **Threads_GetChroot(tProcess *Proc) { return &proc(Proc)->Chroot; }
+int *Threads_GetMaxFD (tProcess *Proc) { return &proc(Proc)->MaxFD; };
tTID Threads_WaitTID(int TID, int *Status)
{
tTID Threads_WaitTID(int TID, int *Status)
{
diff --git
a/AcessNative/acesskernel_src/threads_glue.c
b/AcessNative/acesskernel_src/threads_glue.c
index
fa83980
..
7c13780
100644
(file)
--- a/
AcessNative/acesskernel_src/threads_glue.c
+++ b/
AcessNative/acesskernel_src/threads_glue.c
@@
-20,6
+20,7
@@
typedef void **tShortSpinlock;
#include <pthread.h>
#define NORETURN __attribute__((noreturn))
#include <pthread.h>
#define NORETURN __attribute__((noreturn))
+#include <stdbool.h>
#include <logdebug.h> // Kernel land, but uses standards
#include <errno.h>
#include <logdebug.h> // Kernel land, but uses standards
#include <errno.h>
diff --git
a/AcessNative/acesskernel_src/vfs_handle.c
b/AcessNative/acesskernel_src/vfs_handle.c
index
6c3992f
..
93b6a9d
100644
(file)
--- a/
AcessNative/acesskernel_src/vfs_handle.c
+++ b/
AcessNative/acesskernel_src/vfs_handle.c
@@
-79,7
+79,7
@@
void VFS_CloneHandleList(int PID)
ent = VFS_int_GetUserHandles(PID, 1);
ent = VFS_int_GetUserHandles(PID, 1);
- maxhandles = *Threads_GetMaxFD();
+ maxhandles = *Threads_GetMaxFD(
NULL
);
memcpy(ent->Handles, cur->Handles, maxhandles*sizeof(tVFS_Handle));
// Reference all
memcpy(ent->Handles, cur->Handles, maxhandles*sizeof(tVFS_Handle));
// Reference all
@@
-105,7
+105,7
@@
void VFS_CloneHandlesFromList(int PID, int nFD, int FDs[])
LOG("Copying %i FDs from %i", nFD, PID);
LOG("Copying %i FDs from %i", nFD, PID);
- maxhandles = *Threads_GetMaxFD();
+ maxhandles = *Threads_GetMaxFD(
NULL
);
if( nFD > maxhandles )
nFD = maxhandles;
for( int i = 0; i < nFD; i ++ )
if( nFD > maxhandles )
nFD = maxhandles;
for( int i = 0; i < nFD; i ++ )
@@
-156,7
+156,7
@@
tVFS_Handle *VFS_GetHandle(int FD)
else
{
int pid = Threads_GetPID();
else
{
int pid = Threads_GetPID();
- int maxhandles = *Threads_GetMaxFD();
+ int maxhandles = *Threads_GetMaxFD(
NULL
);
tUserHandles *ent = VFS_int_GetUserHandles(pid, 0);
if(!ent) {
tUserHandles *ent = VFS_int_GetUserHandles(pid, 0);
if(!ent) {
@@
-193,7
+193,7
@@
int VFS_SetHandle(int FD, tVFS_Node *Node, int Mode)
else {
tUserHandles *ent;
int pid = Threads_GetPID();
else {
tUserHandles *ent;
int pid = Threads_GetPID();
- int maxhandles = *Threads_GetMaxFD();
+ int maxhandles = *Threads_GetMaxFD(
NULL
);
ent = VFS_int_GetUserHandles(pid, 0);
if(!ent) {
ent = VFS_int_GetUserHandles(pid, 0);
if(!ent) {
@@
-219,7
+219,7
@@
int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode)
if(bIsUser)
{
tUserHandles *ent;
if(bIsUser)
{
tUserHandles *ent;
- int maxhandles = *Threads_GetMaxFD();
+ int maxhandles = *Threads_GetMaxFD(
NULL
);
// Find the PID's handle list
ent = VFS_int_GetUserHandles(Threads_GetPID(), 1);
// Get a handle
// Find the PID's handle list
ent = VFS_int_GetUserHandles(Threads_GetPID(), 1);
// Get a handle
@@
-254,7
+254,7
@@
void VFS_ClearHandles(int PID)
tUserHandles *ent = VFS_int_GetUserHandles(PID, 0);
if( !ent ) return;
// Get a handle
tUserHandles *ent = VFS_int_GetUserHandles(PID, 0);
if( !ent ) return;
// Get a handle
- int maxhandles = *Threads_GetMaxFD();
+ int maxhandles = *Threads_GetMaxFD(
NULL
);
for( int i = 0; i < maxhandles; i ++ )
{
if(ent->Handles[i].Node) continue;
for( int i = 0; i < maxhandles; i ++ )
{
if(ent->Handles[i].Node) continue;
diff --git
a/AcessNative/ld-acess_src/binary.c
b/AcessNative/ld-acess_src/binary.c
index
59be829
..
738c6e8
100644
(file)
--- a/
AcessNative/ld-acess_src/binary.c
+++ b/
AcessNative/ld-acess_src/binary.c
@@
-6,6
+6,7
@@
* - Provides binary loading and type abstraction
*/
#define DEBUG 0
* - Provides binary loading and type abstraction
*/
#define DEBUG 0
+#define _POSIX_C_SOURCE 200809L // needed for strdup
#include "common.h"
#include <stdint.h>
#include <stdio.h>
#include "common.h"
#include <stdint.h>
#include <stdio.h>
@@
-228,7
+229,7
@@
void Binary_SetReadyToUse(void *Base)
}
}
}
}
-int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value, size_t *Size)
+int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value, size_t *Size
, void *IgnoreBase
)
{
int i;
tBinary *bin;
{
int i;
tBinary *bin;
@@
-251,6
+252,7
@@
int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value, size_t *Size)
// Search list of loaded binaries
for(bin = gLoadedBinaries; bin; bin = bin->Next)
{
// Search list of loaded binaries
for(bin = gLoadedBinaries; bin; bin = bin->Next)
{
+ if( bin->Base == IgnoreBase ) continue ;
if( !bin->Ready ) continue;
//printf(" Binary_GetSymbol: bin = %p{%p, %s}\n", bin, bin->Base, bin->Path);
if( bin->Format->GetSymbol(bin->Base, (char*)SymbolName, Value, Size) )
if( !bin->Ready ) continue;
//printf(" Binary_GetSymbol: bin = %p{%p, %s}\n", bin, bin->Base, bin->Path);
if( bin->Format->GetSymbol(bin->Base, (char*)SymbolName, Value, Size) )
diff --git
a/AcessNative/ld-acess_src/common.h
b/AcessNative/ld-acess_src/common.h
index
9f67e9c
..
0bdc40f
100644
(file)
--- a/
AcessNative/ld-acess_src/common.h
+++ b/
AcessNative/ld-acess_src/common.h
@@
-8,16
+8,16
@@
#include <stdint.h>
#include <string.h>
#include <stdint.h>
#include <string.h>
-extern int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value, size_t *Size);
+extern int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value, size_t *Size
, void *IgnoreBase
);
extern void *Binary_LoadLibrary(const char *Path);
extern void *Binary_Load(const char *Path, uintptr_t *EntryPoint);
extern void Binary_SetReadyToUse(void *Base);
// HACKS - So this can share the usermode elf.c
extern void *Binary_LoadLibrary(const char *Path);
extern void *Binary_Load(const char *Path, uintptr_t *EntryPoint);
extern void Binary_SetReadyToUse(void *Base);
// HACKS - So this can share the usermode elf.c
-static inline int GetSymbol(const char *sym, void **val, size_t *sz)
+static inline int GetSymbol(const char *sym, void **val, size_t *sz
, void *IgnoreBase
)
{
uintptr_t rv;
{
uintptr_t rv;
- if( !Binary_GetSymbol(sym, &rv, sz) )
+ if( !Binary_GetSymbol(sym, &rv, sz
, IgnoreBase
) )
return 0;
*val = (void*)rv;
return 1;
return 0;
*val = (void*)rv;
return 1;
diff --git
a/AcessNative/ld-acess_src/elf_load.c
b/AcessNative/ld-acess_src/elf_load.c
index
19a8c13
..
c5edc4a
100644
(file)
--- a/
AcessNative/ld-acess_src/elf_load.c
+++ b/
AcessNative/ld-acess_src/elf_load.c
@@
-74,7
+74,7
@@
void *Elf32Load(int FD, Elf32_Ehdr *hdr)
ENTER("iFD", FD);
\r
\r
// Check for a program header
\r
ENTER("iFD", FD);
\r
\r
// Check for a program header
\r
- if(hdr->phoff == 0) {
\r
+ if(hdr->
e_
phoff == 0) {
\r
#if DEBUG_WARN
\r
Warning("ELF File does not contain a program header\n");
\r
#endif
\r
#if DEBUG_WARN
\r
Warning("ELF File does not contain a program header\n");
\r
#endif
\r
@@
-83,25
+83,25
@@
void *Elf32Load(int FD, Elf32_Ehdr *hdr)
}
\r
\r
// Read Program Header Table
\r
}
\r
\r
// Read Program Header Table
\r
- phtab = malloc( sizeof(Elf32_Phdr) * hdr->
phentcount
);
\r
+ phtab = malloc( sizeof(Elf32_Phdr) * hdr->
e_phnum
);
\r
if( !phtab ) {
\r
LEAVE('n');
\r
return NULL;
\r
}
\r
if( !phtab ) {
\r
LEAVE('n');
\r
return NULL;
\r
}
\r
- LOG("hdr.
phoff = 0x%08x\n", hdr->
phoff);
\r
- acess__SysSeek(FD, hdr->phoff, ACESS_SEEK_SET);
\r
- acess__SysRead(FD, phtab, sizeof(Elf32_Phdr) * hdr->
phentcount
);
\r
+ LOG("hdr.
e_phoff = 0x%08x\n", hdr->e_
phoff);
\r
+ acess__SysSeek(FD, hdr->
e_
phoff, ACESS_SEEK_SET);
\r
+ acess__SysRead(FD, phtab, sizeof(Elf32_Phdr) * hdr->
e_phnum
);
\r
\r
// Count Pages
\r
iPageCount = 0;
\r
\r
// Count Pages
\r
iPageCount = 0;
\r
- LOG("hdr.
phentcount = %i\n", hdr->phentcount
);
\r
- for( i = 0; i < hdr->
phentcount
; i++ )
\r
+ LOG("hdr.
e_phnum = %i\n", hdr->e_phnum
);
\r
+ for( i = 0; i < hdr->
e_phnum
; i++ )
\r
{
\r
// Ignore Non-LOAD types
\r
{
\r
// Ignore Non-LOAD types
\r
- if(phtab[i].
T
ype != PT_LOAD)
\r
+ if(phtab[i].
p_t
ype != PT_LOAD)
\r
continue;
\r
continue;
\r
- iPageCount += ((phtab[i].
VAddr&0xFFF) + phtab[i].MemSize
+ 0xFFF) >> 12;
\r
- LOG("phtab[%i] = {
VAddr:0x%x, MemSize:0x%x}\n", i, phtab[i].VA
ddr, phtab[i].MemSize);
\r
+ iPageCount += ((phtab[i].
p_vaddr&0xFFF) + phtab[i].p_memsz
+ 0xFFF) >> 12;
\r
+ LOG("phtab[%i] = {
p_vaddr:0x%x, p_memsz:0x%x}\n", i, phtab[i].p_va
ddr, phtab[i].MemSize);
\r
}
\r
\r
LOG("iPageCount = %i\n", iPageCount);
\r
}
\r
\r
LOG("iPageCount = %i\n", iPageCount);
\r
@@
-117,14
+117,14
@@
void *Elf32Load(int FD, Elf32_Ehdr *hdr)
// Prescan for base and size
\r
max = 0;
\r
base = 0xFFFFFFFF;
\r
// Prescan for base and size
\r
max = 0;
\r
base = 0xFFFFFFFF;
\r
- for( i = 0; i < hdr->
phentcount
; i ++)
\r
+ for( i = 0; i < hdr->
e_phnum
; i ++)
\r
{
\r
{
\r
- if( phtab[i].
T
ype != PT_LOAD )
\r
+ if( phtab[i].
p_t
ype != PT_LOAD )
\r
continue;
\r
continue;
\r
- if( phtab[i].
VA
ddr < base )
\r
- base = phtab[i].
VA
ddr;
\r
- if( phtab[i].
VAddr + phtab[i].MemSize
> max )
\r
- max = phtab[i].
VAddr + phtab[i].MemSize
;
\r
+ if( phtab[i].
p_va
ddr < base )
\r
+ base = phtab[i].
p_va
ddr;
\r
+ if( phtab[i].
p_vaddr + phtab[i].p_memsz
> max )
\r
+ max = phtab[i].
p_vaddr + phtab[i].p_memsz
;
\r
}
\r
\r
LOG("base = %08x, max = %08x\n", base, max);
\r
}
\r
\r
LOG("base = %08x, max = %08x\n", base, max);
\r
@@
-138,39
+138,39
@@
void *Elf32Load(int FD, Elf32_Ehdr *hdr)
}
\r
\r
// Load Pages
\r
}
\r
\r
// Load Pages
\r
- for( i = 0; i < hdr->
phentcount
; i++ )
\r
+ for( i = 0; i < hdr->
e_phnum
; i++ )
\r
{
\r
// Get Interpreter Name
\r
{
\r
// Get Interpreter Name
\r
- if( phtab[i].
T
ype == PT_INTERP )
\r
+ if( phtab[i].
p_t
ype == PT_INTERP )
\r
{
\r
char *tmp;
\r
//if(ret->Interpreter) continue;
\r
{
\r
char *tmp;
\r
//if(ret->Interpreter) continue;
\r
- tmp = malloc(phtab[i].
FileSize
);
\r
- acess__SysSeek(FD, phtab[i].
O
ffset, ACESS_SEEK_SET);
\r
- acess__SysRead(FD, tmp, phtab[i].
FileSize
);
\r
+ tmp = malloc(phtab[i].
p_filesz
);
\r
+ acess__SysSeek(FD, phtab[i].
p_o
ffset, ACESS_SEEK_SET);
\r
+ acess__SysRead(FD, tmp, phtab[i].
p_filesz
);
\r
//ret->Interpreter = Binary_RegInterp(tmp);
\r
LOG("Interpreter '%s'\n", tmp);
\r
free(tmp);
\r
continue;
\r
}
\r
// Ignore non-LOAD types
\r
//ret->Interpreter = Binary_RegInterp(tmp);
\r
LOG("Interpreter '%s'\n", tmp);
\r
free(tmp);
\r
continue;
\r
}
\r
// Ignore non-LOAD types
\r
- if(phtab[i].
Type != PT_LOAD)
continue;
\r
+ if(phtab[i].
p_type != PT_LOAD)
continue;
\r
\r
\r
- LOG("phtab[%i] = PT_LOAD {Adj
VAddr:0x%x, Offset:0x%x, FileSize:0x%x, MemSize
:0x%x}\n",
\r
- i, phtab[i].
VAddr+baseDiff, phtab[i].Offset, phtab[i].FileSize, phtab[i].MemSize
);
\r
+ LOG("phtab[%i] = PT_LOAD {Adj
p_vaddr:0x%x, p_offset:0x%x, p_filesz:0x%x, p_memsz
:0x%x}\n",
\r
+ i, phtab[i].
p_vaddr+baseDiff, phtab[i].p_offset, phtab[i].p_filesz, phtab[i].p_memsz
);
\r
\r
\r
- addr = phtab[i].
VA
ddr + baseDiff;
\r
+ addr = phtab[i].
p_va
ddr + baseDiff;
\r
\r
\r
- if( AllocateMemory( addr, phtab[i].
MemSize
) ) {
\r
+ if( AllocateMemory( addr, phtab[i].
p_memsz
) ) {
\r
fprintf(stderr, "Elf_Load: Unable to map memory at %x (0x%x bytes)\n",
\r
fprintf(stderr, "Elf_Load: Unable to map memory at %x (0x%x bytes)\n",
\r
- addr, phtab[i].
MemSize
);
\r
+ addr, phtab[i].
p_memsz
);
\r
free( phtab );
\r
return NULL;
\r
}
\r
\r
free( phtab );
\r
return NULL;
\r
}
\r
\r
- acess__SysSeek(FD, phtab[i].
O
ffset, ACESS_SEEK_SET);
\r
- acess__SysRead(FD, PTRMK(void, addr), phtab[i].
FileSize
);
\r
- memset( PTRMK(char, addr) + phtab[i].
FileSize, 0, phtab[i].MemSize - phtab[i].FileSize
);
\r
+ acess__SysSeek(FD, phtab[i].
p_o
ffset, ACESS_SEEK_SET);
\r
+ acess__SysRead(FD, PTRMK(void, addr), phtab[i].
p_filesz
);
\r
+ memset( PTRMK(char, addr) + phtab[i].
p_filesz, 0, phtab[i].p_memsz - phtab[i].p_filesz
);
\r
}
\r
\r
// Clean Up
\r
}
\r
\r
// Clean Up
\r
@@
-210,20
+210,20
@@
void *Elf64Load(int FD, Elf64_Ehdr *hdr)
LEAVE('n');
\r
return NULL;
\r
}
\r
LEAVE('n');
\r
return NULL;
\r
}
\r
- LOG("hdr.phoff = 0x%08llx\n", (long long)hdr->e_phoff);
\r
+ LOG("hdr.
e_
phoff = 0x%08llx\n", (long long)hdr->e_phoff);
\r
acess__SysSeek(FD, hdr->e_phoff, ACESS_SEEK_SET);
\r
acess__SysRead(FD, phtab, sizeof(Elf64_Phdr) * hdr->e_phnum);
\r
\r
// Count Pages
\r
iPageCount = 0;
\r
acess__SysSeek(FD, hdr->e_phoff, ACESS_SEEK_SET);
\r
acess__SysRead(FD, phtab, sizeof(Elf64_Phdr) * hdr->e_phnum);
\r
\r
// Count Pages
\r
iPageCount = 0;
\r
- LOG("hdr.
phentcount
= %i\n", hdr->e_phnum);
\r
+ LOG("hdr.
e_phnum
= %i\n", hdr->e_phnum);
\r
for( i = 0; i < hdr->e_phnum; i++ )
\r
{
\r
// Ignore Non-LOAD types
\r
if(phtab[i].p_type != PT_LOAD)
\r
continue;
\r
iPageCount += ((phtab[i].p_vaddr&0xFFF) + phtab[i].p_memsz + 0xFFF) >> 12;
\r
for( i = 0; i < hdr->e_phnum; i++ )
\r
{
\r
// Ignore Non-LOAD types
\r
if(phtab[i].p_type != PT_LOAD)
\r
continue;
\r
iPageCount += ((phtab[i].p_vaddr&0xFFF) + phtab[i].p_memsz + 0xFFF) >> 12;
\r
- LOG("phtab[%i] = {
VAddr:0x%llx, MemSize
:0x%llx}\n",
\r
+ LOG("phtab[%i] = {
p_vaddr:0x%llx, p_memsz
:0x%llx}\n",
\r
i, (long long)phtab[i].p_vaddr, (long long)phtab[i].p_memsz);
\r
}
\r
\r
i, (long long)phtab[i].p_vaddr, (long long)phtab[i].p_memsz);
\r
}
\r
\r
@@
-280,7
+280,7
@@
void *Elf64Load(int FD, Elf64_Ehdr *hdr)
// Ignore non-LOAD types
\r
if(phtab[i].p_type != PT_LOAD) continue;
\r
\r
// Ignore non-LOAD types
\r
if(phtab[i].p_type != PT_LOAD) continue;
\r
\r
- LOG("phtab[%i] = PT_LOAD {Adj
VAddr:0x%llx, Offset:0x%llx, FileSize:0x%llx, MemSize
:0x%llx}\n",
\r
+ LOG("phtab[%i] = PT_LOAD {Adj
p_vaddr:0x%llx, p_offset:0x%llx, p_filesz:0x%llx, p_memsz
:0x%llx}\n",
\r
i,
\r
(long long)phtab[i].p_vaddr+baseDiff, (long long)phtab[i].p_offset,
\r
(long long)phtab[i].p_filesz, (long long)phtab[i].p_memsz
\r
i,
\r
(long long)phtab[i].p_vaddr+baseDiff, (long long)phtab[i].p_offset,
\r
(long long)phtab[i].p_filesz, (long long)phtab[i].p_memsz
\r
diff --git
a/AcessNative/ld-acess_src/memory.c
b/AcessNative/ld-acess_src/memory.c
index
c8166af
..
99238a5
100644
(file)
--- a/
AcessNative/ld-acess_src/memory.c
+++ b/
AcessNative/ld-acess_src/memory.c
@@
-1,5
+1,6
@@
/*
*/
/*
*/
+#define _GNU_SOURCE // needed for MAP_ANONYMOUS to be avaliable
#include "common.h"
#include <stdio.h>
#include <stdlib.h>
#include "common.h"
#include <stdio.h>
#include <stdlib.h>
diff --git
a/AcessNative/ld-acess_src/request.c
b/AcessNative/ld-acess_src/request.c
index
fdf5748
..
c516a22
100644
(file)
--- a/
AcessNative/ld-acess_src/request.c
+++ b/
AcessNative/ld-acess_src/request.c
@@
-25,6
+25,7
@@
# include <unistd.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <unistd.h>
# include <sys/socket.h>
# include <netinet/in.h>
+# include <sys/select.h>
#endif
#include "request.h"
#include "../syscalls.h"
#endif
#include "request.h"
#include "../syscalls.h"
UCC
git Repository :: git.ucc.asn.au