summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Blundell <pb@futuretv.com>2000-10-16 17:57:08 +0000
committerPhil Blundell <pb@futuretv.com>2000-10-16 17:57:08 +0000
commitfa94a8071d4adfed6cd22772b2a2f38e188b70d9 (patch)
tree2bbc1d28caa725567c03c06c9b777f64b91c98e4
parent79bc04750895b8e3dbd8064b2552284abf745072 (diff)
downloadgdb-fa94a8071d4adfed6cd22772b2a2f38e188b70d9.tar.gz
Merge from mainline
-rw-r--r--bfd/ChangeLog31
-rw-r--r--bfd/elf32-arm.h22
-rw-r--r--bfd/elflink.c14
-rw-r--r--bfd/elflink.h23
4 files changed, 77 insertions, 13 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5f85aad38a5..7659ec68400 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,34 @@
+2000-10-15 Philip Blundell <philb@gnu.org>
+
+ From 2000-09-08 Nick Clifton <nickc@redhat.com>
+ * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not
+ initialise flags in output bfd if the input bfd is the default
+ architecture with the default flags.
+
+ From 2000-09-03 Philip Blundell <philb@gnu.org>
+ * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate
+ references to undefined symbols in debugging sections.
+
+ From 2000-05-30 H.J. Lu <hjl@gnu.org>
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the
+ visibility bits if the symbol is undefined. Correctly handle
+ weak undefined symbols with hidden and internal attributes.
+ * elflink.h (elf_link_add_object_symbols): Always turn the
+ symbol into local if it has the hidden or internal attribute.
+
+ From 2000-05-22 H.J. Lu <hjl@gnu.org>
+ * elflink.h (elf_link_output_extsym): Clear the visibility
+ field for symbols not defined locally.
+
+ From 2000-05-03 Martin v. Löwis <loewis@informatik.hu-berlin.de>
+ * elflink.h (elf_link_add_object_symbols): Reset dynindx for
+ hidden and internal symbols.
+ (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with
+ visibility.
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not
+ assign a PLT or GOT entry to symbols with hidden and
+ internal visibility.
+
2000-10-16 Philip Blundell <pb@futuretv.com>
* configure.in: Set version to 2.10.1.
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index eaaf9763b40..7cb5bbc2332 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1756,7 +1756,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
(!info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
)
- && ((input_section->flags & SEC_ALLOC) != 0)
+ && ((input_section->flags & SEC_ALLOC) != 0
+ /* DWARF will emit R_ARM_ABS32 relocations in its
+ sections against symbols defined externally
+ in shared libraries. We can't do anything
+ with them here. */
+ || ((input_section->flags & SEC_DEBUGGING) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
)
relocation_needed = 0;
break;
@@ -1994,13 +2001,14 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd)
if (!elf_flags_init (obfd))
{
- /* If the input is the default architecture then do not
- bother setting the flags for the output architecture,
- instead allow future merges to do this. If no future
- merges ever set these flags then they will retain their
- unitialised values, which surprise surprise, correspond
+ /* If the input is the default architecture and had the default
+ flags then do not bother setting the flags for the output
+ architecture, instead allow future merges to do this. If no
+ future merges ever set these flags then they will retain their
+ uninitialised values, which surprise surprise, correspond
to the default values. */
- if (bfd_get_arch_info (ibfd)->the_default)
+ if (bfd_get_arch_info (ibfd)->the_default
+ && elf_elfheader (ibfd)->e_flags == 0)
return true;
elf_flags_init (obfd) = true;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 6534d84b18a..c593e496f95 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -235,11 +235,17 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
(*info->callbacks->undefined_symbol)
(info, name, abfd, bfd_und_section_ptr, 0, true);
+
+ /* We have flaged a fatal error. We now treat this as
+ a normal symbol to avoid further error messages. */
+ h->other ^= ELF_ST_VISIBILITY (h->other);
}
-
- h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- break;
-
+ else if (h->root.type != bfd_link_hash_undefweak)
+ {
+ h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+ return true;
+ }
+
default:
break;
}
diff --git a/bfd/elflink.h b/bfd/elflink.h
index bddf2907119..0230892553c 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -1852,6 +1852,18 @@ elf_link_add_object_symbols (abfd, info)
goto error_return;
}
}
+ else if (dynsym && h->dynindx != -1)
+ /* If the symbol already has a dynamic index, but
+ visibility says it should not be visible, turn it into
+ a local symbol. */
+ switch (ELF_ST_VISIBILITY (h->other))
+ {
+ case STV_INTERNAL:
+ case STV_HIDDEN:
+ h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+ (*bed->elf_backend_hide_symbol) (h);
+ break;
+ }
}
}
@@ -3339,10 +3351,12 @@ elf_fix_symbol_flags (h, eif)
/* If -Bsymbolic was used (which means to bind references to global
symbols to the definition within the shared object), and this
symbol was defined in a regular object, then it actually doesn't
- need a PLT entry. */
+ need a PLT entry. Likewise, if the symbol has any kind of
+ visibility (internal, hidden, or protected), it doesn't need a
+ PLT. */
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
&& eif->info->shared
- && eif->info->symbolic
+ && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other))
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
{
h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
@@ -5072,6 +5086,11 @@ elf_link_output_extsym (h, data)
sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
}
+ /* If a symbol is not defined locally, we clear the visibility
+ field. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other);
+
/* If this symbol should be put in the .dynsym section, then put it
there now. We have already know the symbol index. We also fill
in the entry in the .hash section. */