Hiding symbols in a static library

Erik de Castro Lopo mle+tools@mega-nerd.com
Mon Sep 28 07:58:00 GMT 2009


Ian Lance Taylor wrote:

> If it's OK to use ld -r instead of building an archive, then it may
> work to use ld -r with --retain-symbols-file.

I've tried a couple of different versions of this:

    ld -r --retain-symbols-file=Symbols.static \
        libA.a libB.a libC.a libD.a -o output.o

The four archives are all > 40kbytes, but the output file is always
257 bytes in size. Regardless of what I try, there are never any
warning or error messages.

I've also tried using object files instead of archives, but that creates
an object file still seems to export all the symbols that should be hidden.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the Binutils mailing list