Implement --exclude-libs for ELF
Alan Modra
amodra@bigpond.net.au
Thu Oct 14 13:32:00 GMT 2004
On Wed, Oct 13, 2004 at 12:38:22PM -0400, Daniel Jacobowitz wrote:
> So I implemented --exclude-libs for ELF.
> + /* If this symbol has default visibility and the user has requested
> + we not re-export it, then mark it as hidden. */
> + if (definition && !dynamic
> + && (abfd->no_export
> + || (abfd->my_archive && abfd->my_archive->no_export))
> + && ELF_ST_VISIBILITY (isym->st_other) == STV_DEFAULT)
> + isym->st_other = STV_HIDDEN | (isym->st_other & ~ ELF_ST_VISIBILITY (-1));
> +
No, don't test for STV_DEFAULT. As you have it, a protected symbol
will be exported. Make anything that isn't STV_INTERNAL (the most
constraining visibility) hidden. Otherwise looks OK.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list