This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: why_live ?
- From: Cary Coutant <ccoutant at google dot com>
- To: Michael Meeks <michael dot meeks at collabora dot com>
- Cc: Binutils <binutils at sourceware dot org>, Tor Lillqvist <tml at collabora dot com>, Sriraman Tallam <tmsriram at google dot com>
- Date: Thu, 24 Apr 2014 13:07:34 -0700
- Subject: Re: why_live ?
- Authentication-results: sourceware.org; auth=none
- References: <1398366958 dot 16955 dot 185 dot camel at linux-5pcc dot site>
> However, there are still a number of things stuck in there that it is
> hard to determine why they are needed; of course - it is possible to manually
> remove them, and see who the linker complains about wrt. their users :-) and
> repeat that process to get some view of why; however Apple's linker has a
> -why_live parameter that helps a lot here:
>
> http://www.unix.com/man-page/osx/1/ld/
>
> I was wondering if gold / ld have some moral equivalent ? The output
> shows the chain of references that suck the symbol on; eg.
>
> http://users.freedesktop.org/~michael/why_live.filt.txt
>
> Is there an equivalent for binutils ?
In both gold and Gnu ld, the --print-map option will tell you why it
loaded archive library members, a la -why-load, but as far as I know,
there's no equivalent for -why-live. Both linkers have
--print-gc-sections, but that's not really even close. I agree that it
would be a nice feature, though.
-cary