Reference Linker Script Varaible from Source File
Posted: Mon Dec 10, 2007 1:23 pm
Hey guys,
I am having a problem where I am not able to access a compile-time constant that I have defined in my linker script. I am using a Cygwin i386 ELF cross compiler w/ Gnu AS.
Anyways, I defined my kernel's load address to be at 0x100000 when paging isn't yet enabled and at 0xC0000000 when it has. Well the problem is that in my startup source (init_i386.S) I have an external reference to the virtual address variable in my linker script, yet when I goto compile my startup source it complains about an "undefined" variable. Should this be happening? So I then replace the external variable with a constant 0xC0000000 and recompile and everything is fine. So what am I doing wrong?
Do I need to define the variable as a macro during compilation and have it passed to the linker script instead of the linker script defining it and my source trying to acquire it?
Thanks in advance.
I am having a problem where I am not able to access a compile-time constant that I have defined in my linker script. I am using a Cygwin i386 ELF cross compiler w/ Gnu AS.
Anyways, I defined my kernel's load address to be at 0x100000 when paging isn't yet enabled and at 0xC0000000 when it has. Well the problem is that in my startup source (init_i386.S) I have an external reference to the virtual address variable in my linker script, yet when I goto compile my startup source it complains about an "undefined" variable. Should this be happening? So I then replace the external variable with a constant 0xC0000000 and recompile and everything is fine. So what am I doing wrong?
Do I need to define the variable as a macro during compilation and have it passed to the linker script instead of the linker script defining it and my source trying to acquire it?
Thanks in advance.