• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision8f33925de3039f880e949280b6f26bf2855d44e3 (tree)
Time2000-10-17 02:57:08
AuthorPhil Blundell <philb@gnu....>
CommiterPhil Blundell

Log Message

Merge from mainline

Change Summary

Incremental Difference

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,34 @@
1+2000-10-15 Philip Blundell <philb@gnu.org>
2+
3+ From 2000-09-08 Nick Clifton <nickc@redhat.com>
4+ * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not
5+ initialise flags in output bfd if the input bfd is the default
6+ architecture with the default flags.
7+
8+ From 2000-09-03 Philip Blundell <philb@gnu.org>
9+ * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate
10+ references to undefined symbols in debugging sections.
11+
12+ From 2000-05-30 H.J. Lu <hjl@gnu.org>
13+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the
14+ visibility bits if the symbol is undefined. Correctly handle
15+ weak undefined symbols with hidden and internal attributes.
16+ * elflink.h (elf_link_add_object_symbols): Always turn the
17+ symbol into local if it has the hidden or internal attribute.
18+
19+ From 2000-05-22 H.J. Lu <hjl@gnu.org>
20+ * elflink.h (elf_link_output_extsym): Clear the visibility
21+ field for symbols not defined locally.
22+
23+ From 2000-05-03 Martin v. Löwis <loewis@informatik.hu-berlin.de>
24+ * elflink.h (elf_link_add_object_symbols): Reset dynindx for
25+ hidden and internal symbols.
26+ (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with
27+ visibility.
28+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not
29+ assign a PLT or GOT entry to symbols with hidden and
30+ internal visibility.
31+
132 2000-10-16 Philip Blundell <pb@futuretv.com>
233
334 * configure.in: Set version to 2.10.1.
--- 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,
17561756 (!info->symbolic && h->dynindx != -1)
17571757 || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
17581758 )
1759- && ((input_section->flags & SEC_ALLOC) != 0)
1759+ && ((input_section->flags & SEC_ALLOC) != 0
1760+ /* DWARF will emit R_ARM_ABS32 relocations in its
1761+ sections against symbols defined externally
1762+ in shared libraries. We can't do anything
1763+ with them here. */
1764+ || ((input_section->flags & SEC_DEBUGGING) != 0
1765+ && (h->elf_link_hash_flags
1766+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
17601767 )
17611768 relocation_needed = 0;
17621769 break;
@@ -1994,13 +2001,14 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd)
19942001
19952002 if (!elf_flags_init (obfd))
19962003 {
1997- /* If the input is the default architecture then do not
1998- bother setting the flags for the output architecture,
1999- instead allow future merges to do this. If no future
2000- merges ever set these flags then they will retain their
2001- unitialised values, which surprise surprise, correspond
2004+ /* If the input is the default architecture and had the default
2005+ flags then do not bother setting the flags for the output
2006+ architecture, instead allow future merges to do this. If no
2007+ future merges ever set these flags then they will retain their
2008+ uninitialised values, which surprise surprise, correspond
20022009 to the default values. */
2003- if (bfd_get_arch_info (ibfd)->the_default)
2010+ if (bfd_get_arch_info (ibfd)->the_default
2011+ && elf_elfheader (ibfd)->e_flags == 0)
20042012 return true;
20052013
20062014 elf_flags_init (obfd) = true;
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -235,11 +235,17 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
235235
236236 (*info->callbacks->undefined_symbol)
237237 (info, name, abfd, bfd_und_section_ptr, 0, true);
238+
239+ /* We have flaged a fatal error. We now treat this as
240+ a normal symbol to avoid further error messages. */
241+ h->other ^= ELF_ST_VISIBILITY (h->other);
238242 }
239-
240- h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
241- break;
242-
243+ else if (h->root.type != bfd_link_hash_undefweak)
244+ {
245+ h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
246+ return true;
247+ }
248+
243249 default:
244250 break;
245251 }
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -1852,6 +1852,18 @@ elf_link_add_object_symbols (abfd, info)
18521852 goto error_return;
18531853 }
18541854 }
1855+ else if (dynsym && h->dynindx != -1)
1856+ /* If the symbol already has a dynamic index, but
1857+ visibility says it should not be visible, turn it into
1858+ a local symbol. */
1859+ switch (ELF_ST_VISIBILITY (h->other))
1860+ {
1861+ case STV_INTERNAL:
1862+ case STV_HIDDEN:
1863+ h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
1864+ (*bed->elf_backend_hide_symbol) (h);
1865+ break;
1866+ }
18551867 }
18561868 }
18571869
@@ -3339,10 +3351,12 @@ elf_fix_symbol_flags (h, eif)
33393351 /* If -Bsymbolic was used (which means to bind references to global
33403352 symbols to the definition within the shared object), and this
33413353 symbol was defined in a regular object, then it actually doesn't
3342- need a PLT entry. */
3354+ need a PLT entry. Likewise, if the symbol has any kind of
3355+ visibility (internal, hidden, or protected), it doesn't need a
3356+ PLT. */
33433357 if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
33443358 && eif->info->shared
3345- && eif->info->symbolic
3359+ && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other))
33463360 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
33473361 {
33483362 h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
@@ -5072,6 +5086,11 @@ elf_link_output_extsym (h, data)
50725086 sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
50735087 }
50745088
5089+ /* If a symbol is not defined locally, we clear the visibility
5090+ field. */
5091+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
5092+ sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other);
5093+
50755094 /* If this symbol should be put in the .dynsym section, then put it
50765095 there now. We have already know the symbol index. We also fill
50775096 in the entry in the .hash section. */