gc-sections & debug info

Jafa jafa@silicondust.com
Wed Aug 27 21:52:00 GMT 2003


Hi all,

We have been having problems were insight was showing weird problems with
finding functions and setting breakpoints.

I have traced it down - we use --gc-sections and the linker is correctly
removing all the functions that are not referenced, however leaves all the
debug info for those sections.

Objdump shows all the removed functions at address 0 and then gives offsets
relative to zero for all the c-lines.

Gdb loads this info and thinks that the lines are executable but at invalid
addresses and gets confused.

Any ideas as to how to encourage the linker to remove the debug info for
functions/data that have been removed by gc-sections?

Thanks

Nick



More information about the Binutils mailing list