This is the mail archive of the binutils@sources.redhat.com 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]

Re: 2.10.91: A problem with LINK_ONCE_DISCARD sections on mipsel-linux


On Wed, 4 Oct 2000, I wrote:

> Hmm, I'm still a little intrigued by why x86 gas behaves as it does.

This should fix the x86 problem.  Note that other targets probably behave
the same way for non-global syms in linkonce sections, and it may be
correct to move the "! symbol_used_in_reloc_p" test into gas/write.c

gas/write.c really needs a re-write.

gas/ChangeLog
	* config/tc-i386.h (TC_FIX_ADJUSTABLE): Add check to cover
	non-global syms in linkonce sections.

Index: config/tc-i386.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.h,v
retrieving revision 1.16
diff -u -p -r1.16 tc-i386.h
--- tc-i386.h	2000/09/16 00:56:47	1.16
+++ tc-i386.h	2000/10/05 01:04:41
@@ -43,8 +43,15 @@ extern int tc_i386_fix_adjustable PARAMS
 
 #if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF) || defined (OBJ_MAYBE_COFF) || defined (OBJ_COFF)) && !defined (TE_PE)
 /* This arranges for gas/write.c to not apply a relocation if
-   tc_fix_adjustable() says it is not adjustable.  */
-#define TC_FIX_ADJUSTABLE(fixP) tc_fix_adjustable (fixP)
+   tc_fix_adjustable() says it is not adjustable.
+   The "! symbol_used_in_reloc_p" test is there specifically to cover
+   the case of non-global symbols in linkonce sections.  It's the
+   generally correct thing to do though;  If a reloc is going to be
+   emitted against a symbol then we don't want to adjust the fixup by
+   applying the reloc during assembly.  The reloc will be applied by
+   the linker during final link.  */
+#define TC_FIX_ADJUSTABLE(fixP) \
+  (! symbol_used_in_reloc_p ((fixP)->fx_addsy) && tc_fix_adjustable (fixP))
 #endif
 
 /* This is the relocation type for direct references to GLOBAL_OFFSET_TABLE.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.




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