From ab66cc8d3de66cada678c146831a3b1655bca1e9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 2 Apr 1997 15:49:47 +0000 Subject: [PATCH] * elf32-mips.c (mips16_jump_reloc): Print a warning rather than calling abort. PR 11972. --- bfd/ChangeLog | 5 +++++ bfd/elf32-mips.c | 60 +++++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9355a91..2856c57 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Wed Apr 2 10:49:07 1997 Ian Lance Taylor + + * elf32-mips.c (mips16_jump_reloc): Print a warning rather than + calling abort. + Tue Apr 1 16:18:05 1997 Klaus Kaempf * configure.com: New file. diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index f7ae2ea..5646d1d 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1364,7 +1364,17 @@ mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, } /* FIXME. */ - abort (); + { + static boolean warned; + + if (! warned) + (*_bfd_error_handler) + ("Linking mips16 objects into %s format is not supported", + bfd_get_target (input_section->output_section->owner)); + warned = true; + } + + return bfd_reloc_undefined; } /* Handle a mips16 GP relative reloc. */ @@ -2946,7 +2956,12 @@ mips_elf_is_local_label_name (abfd, name) bfd *abfd; const char *name; { - return name[0] == '$'; + if (name[0] == '$') + return true; + + /* On Irix 6, the labels go back to starting with '.', so we accept + the generic ELF local label syntax as well. */ + return _bfd_elf_is_local_label_name (abfd, name); } /* MIPS ELF uses a special find_nearest_line routine in order the @@ -5014,6 +5029,8 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, == 0))) && (input_section->flags & SEC_ALLOC) != 0) { + boolean skip; + /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ @@ -5023,16 +5040,35 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (sreloc != NULL); } - outrel.r_offset = (rel->r_offset - + input_section->output_section->vma - + input_section->output_offset); + skip = false; + + if (elf_section_data (input_section)->stab_info == NULL) + outrel.r_offset = rel->r_offset; + else + { + bfd_vma off; + + off = (_bfd_stab_section_offset + (output_bfd, &elf_hash_table (info)->stab_info, + input_section, + &elf_section_data (input_section)->stab_info, + rel->r_offset)); + if (off == (bfd_vma) -1) + skip = true; + outrel.r_offset = off; + } + + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); addend = bfd_get_32 (input_bfd, contents + rel->r_offset); - if (h != NULL - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + if (skip) + memset (&outrel, 0, sizeof outrel); + else if (h != NULL + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) { BFD_ASSERT (h->dynindx != -1); outrel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_REL32); @@ -5072,14 +5108,16 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, addend += relocation; } - bfd_put_32 (output_bfd, addend, contents + rel->r_offset); + if (! skip) + bfd_put_32 (output_bfd, addend, contents + rel->r_offset); + bfd_elf32_swap_reloc_out (output_bfd, &outrel, (((Elf32_External_Rel *) sreloc->contents) + sreloc->reloc_count)); ++sreloc->reloc_count; - if (SGI_COMPAT (output_bfd)) + if (! skip && SGI_COMPAT (output_bfd)) { if (scpt == NULL) continue; -- 2.7.4