Day 41: Linkers are upsetting
source link: https://jvns.ca/blog/2013/12/12/day-41-linkers-are-still-upsetting/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Day 41: Linkers are upsetting
Today I spent pretty much the whole day trying to figure out what’s going on with a linker problem I’m having. I’ve fixed it, but I don’t understand why it’s fixed, and I am having no luck.
Allison and I paired on it for a bit, and
we discovered that if we order the sections .text .rodata .data
.bss
, then the ELF file works correctly, but if they’re in any other
order it doesn’t work.
There’s a gist
with the offending linker scripts.
I also created a StackOverflow question but it is not getting any love.
To compensate, I wrote a tiny start of a tutorial about binary formats.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK