"end" symbol from my linker script is zero?
Posted: Thu Jun 16, 2011 3:24 pm
Hey, I was having an odd error when trying to clone a page directory. It was saying that my frame allocator was returning zero. This made no sense, because I explicitly tell the allocator to reserve the first frame as it holds important system stuff. So, I opened up GDB, connected, and began examining variables. I noticed that the pointer to my frame bitmap was NULL. As I stepped through the program (from the beginning) I realized it had always been NULL from the beginning, but for some reason it hadn't caused errors (it should have though... that is the IDT...). I set this pointer to the value of "end" which is exported from my linker script, and should point directly after my kernel, and upon examining "end" in gdb, I realized end was null also! Can you guys think of any reason that the linker would report "end" to be zero? Here is my linker script:
Thanks, Caleb.
Code: Select all
OUTPUT_FORMAT("elf32-i386")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
.text phys : AT(phys) {
code = .;
*(.text)
*(.rodata)
. = ALIGN(4096);
}
.data : AT(phys + (data - code))
{
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .;
}