diff options
Diffstat (limited to 'bfd/elf64-mmix.c')
-rw-r--r-- | bfd/elf64-mmix.c | 56 |
1 files changed, 16 insertions, 40 deletions
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index ca627ef2c05..4b78681faec 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1,5 +1,5 @@ /* MMIX-specific support for 64-bit ELF. - Copyright 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson <hp@bitrange.com> This file is part of BFD, the Binary File Descriptor library. @@ -205,7 +205,7 @@ static bfd_boolean mmix_elf_section_from_bfd_section PARAMS ((bfd *, asection *, int *)); static bfd_boolean mmix_elf_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); static bfd_boolean mmix_elf_is_local_label_name @@ -1474,45 +1474,21 @@ mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section, sec = local_sections [r_symndx]; relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); - name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + name = bfd_section_name (input_bfd, sec); } else { - h = sym_hashes [r_symndx - symtab_hdr->sh_info]; - - 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; + bfd_boolean unresolved_reloc; + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, undefined_signalled); name = h->root.root.string; - - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; - else if (info->shared - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - relocation = 0; - else - { - /* The test on undefined_signalled is redundant at the - moment, but kept for symmetry. */ - if (! undefined_signalled - && ! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, TRUE))) - return FALSE; - undefined_signalled = TRUE; - relocation = 0; - } } r = mmix_final_link_relocate (howto, input_section, @@ -2051,14 +2027,14 @@ mmix_elf_check_relocs (abfd, info, sec, relocs) /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_MMIX_GNU_VTINHERIT: - if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return FALSE; break; /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_MMIX_GNU_VTENTRY: - if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) return FALSE; break; } @@ -2202,7 +2178,7 @@ bfd_boolean mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; - const Elf_Internal_Sym *sym; + Elf_Internal_Sym *sym; const char **namep ATTRIBUTE_UNUSED; flagword *flagsp ATTRIBUTE_UNUSED; asection **secp; @@ -2296,7 +2272,7 @@ mmix_elf_final_link (abfd, info) --abfd->section_count; } - if (! bfd_elf64_bfd_final_link (abfd, info)) + if (! bfd_elf_final_link (abfd, info)) return FALSE; /* Since this section is marked SEC_LINKER_CREATED, it isn't output by |