From: John Hodge Date: Sun, 28 Aug 2011 04:08:16 +0000 (+0800) Subject: Usermode/ld-acess - Disabled PIC (not needed) X-Git-Tag: rel0.11~111 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=refs%2Fheads%2Fmmap_binary;p=tpg%2Facess2.git Usermode/ld-acess - Disabled PIC (not needed) Also added (commented out) debug to malloc() in libc --- diff --git a/Usermode/Libraries/ld-acess.so_src/Makefile b/Usermode/Libraries/ld-acess.so_src/Makefile index 4b99ecd7..2bdfc483 100644 --- a/Usermode/Libraries/ld-acess.so_src/Makefile +++ b/Usermode/Libraries/ld-acess.so_src/Makefile @@ -9,7 +9,7 @@ OBJ += arch/$(ARCHDIR).ao BIN = ld-acess.so EXTRABIN := libld-acess.so -CFLAGS = -g -Wall -fno-builtin -fno-leading-underscore -fno-stack-protector -fPIC +CFLAGS = -g -Wall -fno-builtin -fno-leading-underscore -fno-stack-protector CFLAGS += $(CPPFLAGS) LDFLAGS = -g -T arch/$(ARCHDIR).ld -Map map.txt --export-dynamic diff --git a/Usermode/Libraries/libc.so_src/heap.c b/Usermode/Libraries/libc.so_src/heap.c index 7ce6bca8..4fcc8bed 100644 --- a/Usermode/Libraries/libc.so_src/heap.c +++ b/Usermode/Libraries/libc.so_src/heap.c @@ -54,6 +54,7 @@ EXPORT void *malloc(size_t bytes) void *bestMatchAddr = 0; heap_head *curBlock; +// _SysDebug("&_heap_start = %p, _heap_start = %p", &_heap_start, _heap_start); // Initialise Heap if(_heap_start == NULL) { @@ -63,6 +64,7 @@ EXPORT void *malloc(size_t bytes) } curBlock = _heap_start; +// _SysDebug("_heap_start = %p", _heap_start); bestSize = bytes + sizeof(heap_head) + sizeof(heap_foot) + BLOCK_SIZE - 1; bestSize = (bestSize/BLOCK_SIZE)*BLOCK_SIZE; //Round up to block size