This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Useless `DT_NEEDED` tags after Garbage Collection
On Fri, Oct 19, 2018 at 12:22:26PM +0200, Christoph Conrads wrote:
> If both `--entry` and `--undefined` are missing, I get the following error:
[snip]
> > ld: gc-sections requires either an entry or an undefined symbol
OK. It used to be that -r --gc-sections needed a root symbol to start
marking kept sections, but that isn't really necessary with
--gc-keep-exported since all defined default visibility or protected
visibility symbols are roots.
I'll commit a patch to fix that, but you'll need to continue
specifying at least one --entry or --undefined option with older
linkers. Any --entry will work and most likely continue to do so.
One good option is "--entry=0".
--
Alan Modra
Australia Development Lab, IBM