aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/bfd-in2.h3
-rw-r--r--bfd/bfd.c3
-rw-r--r--bfd/elflink.c8
4 files changed, 20 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2b1905a..888c920 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-16 Daniel Jacobowitz <dan@debian.org>
+
+ * bfd-in2.h: Regenerate.
+ * bfd.c (struct bfd): Add no_export.
+ * elflink.c (elf_link_add_object_symbols): Handle no_export.
+
2004-10-15 Alan Modra <amodra@bigpond.net.au>
* config.bfd: Whitespace cleanup.
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 2e13704..a25bef3 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -3962,6 +3962,9 @@ struct bfd
/* Pointer to structure which contains architecture information. */
const struct bfd_arch_info *arch_info;
+ /* Flag set if symbols from this BFD should not be exported. */
+ bfd_boolean no_export;
+
/* Stuff only useful for archives. */
void *arelt_data;
struct bfd *my_archive; /* The containing archive BFD. */
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 8ebc81a..0126a9f 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -133,6 +133,9 @@ CODE_FRAGMENT
. {* Pointer to structure which contains architecture information. *}
. const struct bfd_arch_info *arch_info;
.
+. {* Flag set if symbols from this BFD should not be exported. *}
+. bfd_boolean no_export;
+.
. {* Stuff only useful for archives. *}
. void *arelt_data;
. struct bfd *my_archive; {* The containing archive BFD. *}
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;