diff options
author | Daniel Jacobowitz <drow@false.org> | 2004-10-16 18:13:54 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2004-10-16 18:13:54 +0000 |
commit | b58f81aef6a84930bcb58db39f2bad0c45383a6d (patch) | |
tree | 3898cd356f0d9f0d894b447a4fdb46915a7bfac0 /bfd/elflink.c | |
parent | fd5008162e2dc522e4fea16de38a355f7e1a43be (diff) | |
download | gdb-b58f81aef6a84930bcb58db39f2bad0c45383a6d.zip gdb-b58f81aef6a84930bcb58db39f2bad0c45383a6d.tar.gz gdb-b58f81aef6a84930bcb58db39f2bad0c45383a6d.tar.bz2 |
bfd/
* bfd-in2.h: Regenerate.
* bfd.c (struct bfd): Add no_export.
* elflink.c (elf_link_add_object_symbols): Handle no_export.
ld/
* ldlang.c (struct excluded_lib, excluded_libs, add_excluded_libs)
(check_excluded_libs): New.
(load_symbols): Call check_excluded_libs.
* ldlang.h (add_excluded_libs): New prototype.
* emultempl/elf32.em (OPTION_EXCLUDED_LIBS): Define.
(gld${EMULATION_NAME}_add_options): Add --exclude-libs.
(gld${EMULATION_NAME}_handle_option): Handle --exclude-libs.
* ld.texinfo (Command Line Variables): Document --exclude-libs.
(Options Specific to i386 PE Targets): Remove --exclude-libs.
ld/testsuite/
* ld-elf/exclude1.s, ld-elf/exclude2.s, ld-elf/exclude.exp: New.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index 75b8c96..68435bb 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -3778,6 +3778,14 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) (*bed->elf_backend_merge_symbol_attribute) (h, isym, definition, dynamic); + /* 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_INTERNAL) + isym->st_other = STV_HIDDEN | (isym->st_other & ~ ELF_ST_VISIBILITY (-1)); + if (isym->st_other != 0 && !dynamic) { unsigned char hvis, symvis, other, nvis; |