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]

PR ld/10269


All architectures supporting indirect function will need to emit
relocs for indirect function references and can't reduce the symbol
to a section symbol.  So revert HJ's fix for x86, and apply this
instead.

	PR ld/10269
	* symbols.c (S_FORCE_RELOC): True for BSF_GNU_INDIRECT_FUNCTION.
	* config/tc-i386.c: Revert 2009-06-13 change.
	* config/tc-i386.h: Likewise.

Index: gas/symbols.c
===================================================================
RCS file: /cvs/src/src/gas/symbols.c,v
retrieving revision 1.95
diff -u -p -r1.95 symbols.c
--- gas/symbols.c	22 Jun 2009 17:56:00 -0000	1.95
+++ gas/symbols.c	29 Jul 2009 05:12:26 -0000
@@ -2053,6 +2053,7 @@ S_FORCE_RELOC (symbolS *s, int strict)
 
   return ((strict
 	   && ((s->bsym->flags & BSF_WEAK) != 0
+	       || (s->bsym->flags & BSF_GNU_INDIRECT_FUNCTION) != 0
 	       || (EXTERN_FORCE_RELOC
 		   && (s->bsym->flags & BSF_GLOBAL) != 0)))
 	  || s->bsym->section == undefined_section
Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.387
diff -u -p -r1.387 tc-i386.c
--- gas/config/tc-i386.c	25 Jul 2009 14:58:54 -0000	1.387
+++ gas/config/tc-i386.c	29 Jul 2009 05:12:30 -0000
@@ -2566,10 +2566,6 @@ tc_i386_fix_adjustable (fixS *fixP ATTRI
       || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
       || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
     return 0;
-
-  if (fixP->fx_addsy != NULL
-      && symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_GNU_INDIRECT_FUNCTION)
-    return 0;
 #endif
   return 1;
 }
@@ -7368,7 +7364,7 @@ md_apply_fix (fixP, valP, seg)
 	  if ((sym_seg == seg
 	       || (symbol_section_p (fixP->fx_addsy)
 		   && sym_seg != absolute_section))
-	      && !TC_FORCE_RELOCATION (fixP))
+	      && !generic_force_reloc (fixP))
 	    {
 	      /* Yes, we add the values in twice.  This is because
 		 bfd_install_relocation subtracts them out again.  I think
Index: gas/config/tc-i386.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.h,v
retrieving revision 1.107
diff -u -p -r1.107 tc-i386.h
--- gas/config/tc-i386.h	25 Jul 2009 14:58:54 -0000	1.107
+++ gas/config/tc-i386.h	29 Jul 2009 05:12:30 -0000
@@ -143,12 +143,6 @@ extern int tc_i386_fix_adjustable (struc
   (OUTPUT_FLAVOR == bfd_target_elf_flavour)
 #endif
 
-/* BSF_GNU_INDIRECT_FUNCTION symbols always need relocatoon.  */
-#define TC_FORCE_RELOCATION(FIX)			\
-  ((symbol_get_bfdsym ((FIX)->fx_addsy)->flags		\
-    & BSF_GNU_INDIRECT_FUNCTION)			\
-   || generic_force_reloc (FIX))
-
 /* This expression evaluates to true if the relocation is for a local
    object for which we still want to do the relocation at runtime.
    False if we are willing to perform this relocation while building

-- 
Alan Modra
Australia Development Lab, IBM


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