X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=bfd%2Felf32-sparc.c;h=60a4dc76fa5023e52871d6a4ce51742f9d693f97;hb=2e549b45b82d7d3191799b7650221fb3ebb03293;hp=9458061909257e5950e7d94f003c7e635879115f;hpb=f8df10f4f595488c4b6a8e49ffc99721d5aefdba;p=binutils-gdb.git diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 94580619092..60a4dc76fa5 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1221,7 +1221,15 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, || ((r_type == R_SPARC_PC10 || r_type == R_SPARC_PC22) && strcmp (h->root.root.string, - "_GLOBAL_OFFSET_TABLE_") != 0)))) + "_GLOBAL_OFFSET_TABLE_") != 0)) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_SPARC_32 relocations in its + sections against symbols defined externally + in shared libraries. We can't do anything + with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) { /* In these cases, we don't need the relocation value. We check specially because in some