I recently spent many hours trying to fix a problematic ld script. Once I had drawn (on paper) all the different sections I could figure out the problem.
So I started searching for some sort of LD script generator, but could not find any! Does anybody know if such a tool exist? Something that can import/export ld scripts or map-file/elf-file and show the different objects/sections and the addresses?
I know there are some IDEs out there where you do not need to worry about LD-scripts but I am using eclipse and it does not even offer syntax highlighting!
To my knowledge, there are no non-proprietary tools for this purpose.
I don't know of any WYSIWYG editors for LD scripts but I may be able to help you graphically debug these types of problems.
I assume that this was a run-time problem and not a compile time problem. If that is the case then you can use the map output from the linker to get an idea of what is going on.
gcc -Wl,-Map=main.map main.c
The map file can then be parsed with grep or you can use a graphical viewer for the file to debug problems with sections and symbols.
You can also use nm to get similar results from a linked executable:
nm -S --size-sort a.out
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With