From 1e2c2e48e0111d59e10cd3c014e0b41bdbae2a33 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 28 Aug 2011 12:08:16 +0800 Subject: [PATCH] Usermode/ld-acess - Disabled PIC (not needed) Also added (commented out) debug to malloc() in libc --- Usermode/Libraries/ld-acess.so_src/Makefile | 2 +- Usermode/Libraries/libc.so_src/heap.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 -- 2.20.1