arm-elf linker mishandling R_ARM_REL32 with -shared

Phil Blundell pb@nexus.co.uk
Thu Apr 22 15:41:00 GMT 2004


Whoops, that last patch contained an egregious typo.  Here is the
correct version.  May I check this one in?

p.
-------------- next part --------------
2004-04-21  Philip Blundell  <pb@nexus.co.uk>

	* elf32-arm.h (elf32_arm_check_relocs): Don't output REL32
	relocs for locally defined symbols during -shared final link.
	(elf32_arm_final_link_relocate): Likewise.

Index: elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.124
diff -u -r1.124 elf32-arm.h
--- elf32-arm.h	25 Mar 2004 12:48:32 -0000	1.124
+++ elf32-arm.h	21 Apr 2004 16:49:16 -0000
@@ -1338,6 +1412,8 @@
 	 into the output file to be resolved at run time.  */
       if (info->shared
 	  && (input_section->flags & SEC_ALLOC)
+	  && (r_type != R_ARM_REL32
+	      || !SYMBOL_CALLS_LOCAL (info, h))
 	  && (h == NULL
 	      || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 	      || h->root.type != bfd_link_hash_undefweak)
@@ -2991,7 +3244,8 @@
 	    if (info->shared
 		&& (sec->flags & SEC_ALLOC) != 0
 		&& ((ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
-		     && ELF32_R_TYPE (rel->r_info) != R_ARM_PLT32)
+		     && ELF32_R_TYPE (rel->r_info) != R_ARM_PLT32
+		     && ELF32_R_TYPE (rel->r_info) != R_ARM_REL32)
 		    || (h != NULL
 			&& (! info->symbolic
 			    || (h->elf_link_hash_flags


More information about the Binutils mailing list