diff options
Diffstat (limited to 'bfd/elf64-hppa.c')
-rw-r--r-- | bfd/elf64-hppa.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 4c88a543a37..f3398c15030 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -956,30 +956,19 @@ elf64_hppa_dynamic_symbol_p (h, info) struct elf_link_hash_entry *h; struct bfd_link_info *info; { - if (h == NULL) - return FALSE; - - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if (h->dynindx == -1) - return FALSE; - - if (h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_defweak) - return TRUE; + /* ??? What, if anything, needs to happen wrt STV_PROTECTED symbols + and relocations that retrieve a function descriptor? Assume the + worst for now. */ + if (_bfd_elf_dynamic_symbol_p (h, info, 1)) + { + /* ??? Why is this here and not elsewhere is_local_label_name. */ + if (h->root.root.string[0] == '$' && h->root.root.string[1] == '$') + return FALSE; - if (h->root.root.string[0] == '$' && h->root.root.string[1] == '$') + return TRUE; + } + else return FALSE; - - if ((info->shared && (!info->symbolic || info->allow_shlib_undefined)) - || ((h->elf_link_hash_flags - & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) - == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))) - return TRUE; - - return FALSE; } /* Mark all funtions exported by this file so that we can later allocate @@ -2269,7 +2258,9 @@ elf64_hppa_finalize_dlt (dyn_h, data) + hppa_info->opd_sec->output_offset + hppa_info->opd_sec->output_section->vma); } - else if (h->root.u.def.section) + else if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section) { value = h->root.u.def.value + h->root.u.def.section->output_offset; if (h->root.u.def.section->output_section) @@ -2678,6 +2669,16 @@ elf64_hppa_elf_get_symbol_type (elf_sym, type) return type; } +static struct bfd_elf_special_section const elf64_hppa_special_sections[]= +{ + { ".fini", 0, NULL, 0, + SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".init", 0, NULL, 0, + SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, NULL, 0, + 0, 0 } +}; + /* The hash bucket size is the standard one, namely 4. */ const struct elf_size_info hppa64_elf_size_info = @@ -2775,6 +2776,7 @@ const struct elf_size_info hppa64_elf_size_info = #define elf_backend_get_symbol_type elf64_hppa_elf_get_symbol_type #define elf_backend_reloc_type_class elf64_hppa_reloc_type_class #define elf_backend_rela_normal 1 +#define elf_backend_special_sections elf64_hppa_special_sections #include "elf64-target.h" @@ -2783,5 +2785,7 @@ const struct elf_size_info hppa64_elf_size_info = #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf64-hppa-linux" +#undef elf_backend_special_sections + #define INCLUDED_TARGET_FILE 1 #include "elf64-target.h" |