This is the mail archive of the binutils@sourceware.org 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]

[PATCH] Don't set has_static_relocs for R_MIPS_JALR


I found this while bootstrapping the R_MIPS_JALR GCC patch.  Without this fix,
R_MIPS_JALR can cause a "non-dynamic relocations refer to dynamic symbol"
error message while calling a shared library function from an executable.

The reason is that has_static_relocs is set for R_MIPS_JALR.  The bug does not
trigger for all shared library function references because %call16 references
have an early exit in _bfd_mips_elf_adjust_dynamic_symbol.  However if a
%got_disp is used the check is performed and it fails.

Regression-tested with ld on mips64octeon-linux.

OK?

Adam

	* elfxx-mips.c (_bfd_mips_elf_check_relocs): Don't set
	has_static_relocs for R_MIPS_JALR.

Index: elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.257
diff -F^\([(a-zA-Z0-9_]\|#define\) -u -p -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.257 elfxx-mips.c
--- elfxx-mips.c	5 Aug 2009 21:17:51 -0000	1.257
+++ elfxx-mips.c	22 Aug 2009 17:55:10 -0000
@@ -7503,6 +7504,11 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
 	    }
 	  break;
 
+	  /* This is just a hint; it can safely be ignored.  Don't set
+	     has_static_relocs for the corresponding symbol.  */
+	case R_MIPS_JALR:
+	  break;
+
 	case R_MIPS_32:
 	case R_MIPS_REL32:
 	case R_MIPS_64:


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