Zlib

H.J. Lu hjl.tools@gmail.com
Sat Oct 4 15:17:00 GMT 2008


On Sat, Oct 04, 2008 at 08:17:12PM +1000, Greg Schafer wrote:
> Hi,
> 
> Testing latest release candidate and I have 3 related issues:
> 
> 1) If zlib is not available at Binutils build time, there are 2 failures in
> the testsuite:
> 
> FAIL: objdump -W
> FAIL: readelf -wa (compressed)
> 
> Surely the testsuite should skip these tests in this scenario? I'll file a
> PR unless someone can explain why this is acceptable.
> 
> 2) When Zlib *is* available, shared Zlib is now linked into every single
> Binutils binary and the shared libbfd. The initial proposal was for
> addr2line, objdump, readelf. Why do the remaining binaries (ar, as, c++filt,
> gprof, ld, nm, objcopy, ranlib, size, strings, strip) all need to be linked
> against zlib?
> 
> 3) My understanding is that Zlib support was added because:
> 
>   "The gold linker can emit compressed sections. There is a gold flag to
>    enable compressed debug sections."
> 
> So, because gold can enable compressed debug sections, I'm now forced to
> have all my Binutils linked against Zlib, even if I'm not building gold?
> This feels kinda wrong.
> 
> I believe there should be a user friendly way to disable linking against
> zlib.

1. Check if linker supports --as-needed/--no-as-needed.
2. Use --as-needed -lz --no-as-needed if possible.


H.J.



More information about the Binutils mailing list