Skip to content
Snippets Groups Projects
Commit 1e2c2e48 authored by John Hodge's avatar John Hodge
Browse files

Usermode/ld-acess - Disabled PIC (not needed)

Also added (commented out) debug to malloc() in libc
parent 82103577
No related merge requests found
...@@ -9,7 +9,7 @@ OBJ += arch/$(ARCHDIR).ao ...@@ -9,7 +9,7 @@ OBJ += arch/$(ARCHDIR).ao
BIN = ld-acess.so BIN = ld-acess.so
EXTRABIN := libld-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) CFLAGS += $(CPPFLAGS)
LDFLAGS = -g -T arch/$(ARCHDIR).ld -Map map.txt --export-dynamic LDFLAGS = -g -T arch/$(ARCHDIR).ld -Map map.txt --export-dynamic
......
...@@ -54,6 +54,7 @@ EXPORT void *malloc(size_t bytes) ...@@ -54,6 +54,7 @@ EXPORT void *malloc(size_t bytes)
void *bestMatchAddr = 0; void *bestMatchAddr = 0;
heap_head *curBlock; heap_head *curBlock;
// _SysDebug("&_heap_start = %p, _heap_start = %p", &_heap_start, _heap_start);
// Initialise Heap // Initialise Heap
if(_heap_start == NULL) if(_heap_start == NULL)
{ {
...@@ -63,6 +64,7 @@ EXPORT void *malloc(size_t bytes) ...@@ -63,6 +64,7 @@ EXPORT void *malloc(size_t bytes)
} }
curBlock = _heap_start; curBlock = _heap_start;
// _SysDebug("_heap_start = %p", _heap_start);
bestSize = bytes + sizeof(heap_head) + sizeof(heap_foot) + BLOCK_SIZE - 1; bestSize = bytes + sizeof(heap_head) + sizeof(heap_foot) + BLOCK_SIZE - 1;
bestSize = (bestSize/BLOCK_SIZE)*BLOCK_SIZE; //Round up to block size bestSize = (bestSize/BLOCK_SIZE)*BLOCK_SIZE; //Round up to block size
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment