objcopy --add-gnu-debuglink and relocatable files

Mike Frysinger vapier@gentoo.org
Sun Jul 8 12:57:00 GMT 2007


On Saturday 07 July 2007, Daniel Jacobowitz wrote:
> On Sat, Jul 07, 2007 at 05:35:18AM -0400, Mike Frysinger wrote:
> > perhaps objcopy should reject --add-gnu-debuglink requests for ET_REL
> > objects ?
>
> No, I've seen people use this on kernel modules.

that makes sense ...

then i'd propose having the section discarded by default since any debug file 
linked to in a relocatable object file will not match the final linked 
object, and if you link multiple .o's which all contain their 
own .gnu_debuglink section, the final linked ELF will have those sections 
merged producing even more useless information in the final ELF.

patch attached
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/binutils/attachments/20070708/e5b2ef72/attachment.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-ld-discard-debuglink.patch
Type: text/x-diff
Size: 717 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070708/e5b2ef72/attachment.bin>


More information about the Binutils mailing list