ld: --gc-sections incompatible with --emit-relocs ?

David Lamy-Charrier david.lamy@gmail.com
Fri Oct 13 01:38:00 GMT 2006

Thanks a lot Nick,

> > Is any of you aware of such a limitation ?
> Yes.  The problem is that if relocations are being emitted, then the
> linker cannot safely discard sections.  This is because the linker does
> not know why the relocations are being emitted, so it cannot tell if the
> relocations associated with (potentially) garbage collected sections
> should be emitted or not.

But I still does not completely understand:
I thought that the garbage collection of unused sections was performed
before emitting relocations ? I am wrong ?
In that case, it means the linker should be able to emit relocations
only for non garbage collected sections. I do not see any interest in
emitting relocations for sections that have been removed.


More information about the Binutils mailing list