[patch committed] Fix R_SH_REL32 handling for protected symbol

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[patch committed] Fix R_SH_REL32 handling for protected symbol

Kaz Kojima
Hi,

I've committed the attached one-liner on mainline according to
the patch proposed by Valeriy E. Ushakov to fix a problem for
the protected symbol with SH linker.  It's tested with the top
level "make -k check" on sh4-unknown-linux-gnu and glibc build
with no new faiulres.

Regards,
        kaz
--
2005-12-31  Valeriy E. Ushakov  <[hidden email]>
            Kaz Kojima  <[hidden email]>

        * elf32-sh.c (sh_elf_relocate_section): Don't reset relocation
        for R_SH_REL32 in shared objects if the symbol is locally called.

--- ORIG/src/bfd/elf32-sh.c 2005-10-28 09:34:07.000000000 +0900
+++ LOCAL/src/bfd/elf32-sh.c 2005-12-31 22:36:42.000000000 +0900
@@ -4693,7 +4693,8 @@ sh_elf_relocate_section (bfd *output_bfd
   || !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