diff --git a/sys/kernel/ld.c b/sys/kernel/ld.c index d5e29d9..aeb3c9c 100644 --- a/sys/kernel/ld.c +++ b/sys/kernel/ld.c @@ -51,12 +51,15 @@ fileDescriptor_t *ldFd = 0x0; Elf_Ehdr *binaryHeader = 0x0; Elf_Phdr *programHeader = 0x0; + Elf_Phdr *programDynamic = 0x0; Elf_Shdr *sectionHeader = 0x0; Elf_Sym *relSymTab = 0x0; Elf_Rel *elfRel = 0x0; Elf_Rela *elfRela = 0x0; Elf_Addr addr; + + /* Open our dynamic linker */ ldFd = fopen(interp, "rb"); @@ -96,7 +99,9 @@ switch (programHeader[i].p_type) { case PT_LOAD: + newLoc = (char*) programHeader[i].p_vaddr + LD_START; + /* Allocate Memory Im Going To Have To Make This Load Memory With Correct Settings so it helps us in the future @@ -121,9 +126,8 @@ kprintf("[%s:%i] PT_DYNAMIC", __FILE__, __LINE__); - /* Now Load Section To Memory */ - //fseek(ldFd, programHeader[i].p_offset, 0x0); - //fread(newLoc, programHeader[i].p_filesz, 1, ldFd); + programDynamic = (char *) programHeader[i].p_vaddr + LD_START; + break; case PT_GNU_STACK: