diff options
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r-- | bfd/elfxx-ia64.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 200b8da1949..c86f7a9eed2 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -910,12 +910,14 @@ static inline boolean is_unwind_section_name (name) const char *name; { - size_t len1, len2; + size_t len1, len2, len3; len1 = sizeof (ELF_STRING_ia64_unwind) - 1; len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; - return (strncmp (name, ELF_STRING_ia64_unwind, len1) == 0 - && strncmp (name, ELF_STRING_ia64_unwind_info, len2) != 0); + len3 = sizeof (ELF_STRING_ia64_unwind_once) - 1; + return ((strncmp (name, ELF_STRING_ia64_unwind, len1) == 0 + && strncmp (name, ELF_STRING_ia64_unwind_info, len2) != 0) + || strncmp (name, ELF_STRING_ia64_unwind_once, len3) == 0); } /* Handle an IA-64 specific section when reading an object file. This @@ -1054,6 +1056,18 @@ elfNN_ia64_final_write_processing (abfd, linker) /* .IA_64.unwindFOO -> FOO */ text_sect = bfd_get_section_by_name (abfd, sname); } + else if (sname + && (len = sizeof (ELF_STRING_ia64_unwind_once) - 1, + strncmp (sname, ELF_STRING_ia64_unwind_once, len)) == 0) + { + /* .gnu.linkonce.ia64unw.FOO -> .gnu.linkonce.t.FOO */ + size_t len2 = sizeof (".gnu.linkonce.t.") - 1; + char *once_name = alloca (len2 + strlen (sname) - len + 1); + + memcpy (once_name, ".gnu.linkonce.t.", len2); + strcpy (once_name + len2, sname + len); + text_sect = bfd_get_section_by_name (abfd, once_name); + } else /* last resort: fall back on .text */ text_sect = bfd_get_section_by_name (abfd, ".text"); @@ -1262,8 +1276,12 @@ elfNN_ia64_dynamic_symbol_p (h, info) if (h->dynindx == -1) return false; - if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) - return false; + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + return false; + } if (h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_defweak) @@ -1402,7 +1420,8 @@ elfNN_ia64_hash_hide_symbol (info, xh) h = (struct elfNN_ia64_link_hash_entry *)xh; h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - h->root.dynindx = -1; + if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + h->root.dynindx = -1; for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) dyn_i->want_plt2 = 0; |