* elf32-sh.c (sh_elf_relocate_section): Don't reset relocation
authorKaz Kojima <kkojima@rr.iij4u.or.jp>
Sat, 31 Dec 2005 16:23:13 +0000 (16:23 +0000)
committerKaz Kojima <kkojima@rr.iij4u.or.jp>
Sat, 31 Dec 2005 16:23:13 +0000 (16:23 +0000)
for R_SH_REL32 in shared objects if the symbol is locally called.

bfd/ChangeLog
bfd/elf32-sh.c

index 731ad0487e73536344dc54d72618fc4bb6cacaa6..dc6be124f7f0ea44a6f54334f32bfcb1a5f740f0 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-31  Valeriy E. Ushakov  <uwe@NetBSD.org>
+           Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * elf32-sh.c (sh_elf_relocate_section): Don't reset relocation
+       for R_SH_REL32 in shared objects if the symbol is locally called.
+
 2005-12-31  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (ppc64_elf_relocate_section): Adjust relocs against
index 4d1e280881fc997f57215afd6c261de67583211f..4d07414cd1be8edbc8247ef21ec6475d470a1653 100644 (file)
@@ -4693,7 +4693,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                          || !h->def_regular)
                      && ((r_type == R_SH_DIR32
                           && !h->forced_local)
-                         || r_type == R_SH_REL32)
+                         || (r_type == R_SH_REL32
+                             && !SYMBOL_CALLS_LOCAL (info, h)))
                      && ((input_section->flags & SEC_ALLOC) != 0
                          /* DWARF will emit R_SH_DIR32 relocations in its
                             sections against symbols defined externally