ELF Linker script quick question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:ELF Linker script quick question

Post by Neo »

Did you test it out on Linux/CYGWIN? I will be trying this out on Linux but need to reboot to do that :(

No one else who tried this?
Only Human
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:ELF Linker script quick question

Post by Colonel Kernel »

Neo wrote:Did you test it out on Linux/CYGWIN?
I tested it on Cygwin. I have a VM with Mandrake 9.2 on it, but I don't remember if I tested with that or not. It has exactly the same verions of binutils and gcc as my Cygwin installation does.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
bkilgore

Re:ELF Linker script quick question

Post by bkilgore »

I remember this happening to me a few months back (the non-constant load base error), and although it's starting to fade a little I'm pretty sure the problem had something to do with missing sections.

In my case, I think my final object file had a .rodata section but I wasn't telling the linker where to put it in the script. Check to see if you have any sections in your object file(s) that are being linked that might not have a home in your linker script.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:ELF Linker script quick question

Post by Neo »

Anyone know where I can get version 2.17 of binutils from? Need to check this out further.
Only Human
bkilgore

Re:ELF Linker script quick question

Post by bkilgore »

Neo wrote: Anyone know where I can get version 2.17 of binutils from? Need to check this out further.
You probably want to get a cvs snapshot since there hasn't been an official stable release. Of course, some people have created releases from the snapshots for various systems, byt cvs is probably your best option
mystran

Re:ELF Linker script quick question

Post by mystran »

Actually, try adding *(COMMON) to .bss. Also, for one reason or other, I'm using *(.rodata*) with the extra star in my script.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:ELF Linker script quick question

Post by Colonel Kernel »

mystran wrote: Also, for one reason or other, I'm using *(.rodata*) with the extra star in my script.
I had to add one to HigherHalfBareBones (and my own kernel) when I started compiling with optimizations enabled. The compiler added new sections called .rodata.something (I forget what the something was). I think it contained string constants, but I don't remember exactly...
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:ELF Linker script quick question

Post by Neo »

mystran wrote: Actually, try adding *(COMMON) to .bss. Also, for one reason or other, I'm using *(.rodata*) with the extra star in my script.

The *(.rodata*) and *(COMMON) are both there in my script. :(
Only Human
mystran

Re:ELF Linker script quick question

Post by mystran »

Ahm, ok, sorry, must have looked at the other script posted to this thread. :)
Post Reply