This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Fix -Bsymbolic-functions for SPARC

Hi David,

  The linker test that checks the -Bsymbolic-functions option is failing
  for SPARC targets.  The test fails because the linker creates an
  R_SPARC_32 reloc against "fun" rather than a RELATIVE reloc or an ADDR
  reloc against .text.

  Tracing the problem back through the linker lead me to the code in
  _bfd_sparc_elf_relocate_section where it checks to see if a reloc
  should be preserved or converted.  This then lead to the following
  patch.  It works for the linker test, but I am not familiar enough
  with the SPARC API to know if there might be a problem with the

  The patch itself is simple enough - it replaces the "! is_plt" part of
  the check with a test for PC relative relocs.  This matches the
  behaviour of the x86_64 version of the same function, but is it
  correct for the SPARC ?


diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index db0d4f18..f85703e 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -3470,7 +3470,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
 		 become local.  */
 	      else if (h != NULL &&
 		       h->dynindx != -1
-		       && (! is_plt
+		       && (_bfd_sparc_elf_howto_table[r_type].pc_relative
 			   || !bfd_link_pic (info)
 			   || !SYMBOLIC_BIND (info, h)
 			   || !h->def_regular))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]