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]
Other format: [Raw text]

Re: Problems with the 2003-01-23 patch (was Re: [PATCH] Fix s390 as)


On Wed, Feb 12, 2003 at 02:22:19PM +0100, Jakub Jelinek wrote:
> Wouldn't something like:
> (! SEG_NORMAL (SEG)
>  || (EXTERN_FORCE_RELOC
>      && (S_IS_EXTERNAL ((FIX)->fx_addsy)
> 	 || S_IS_EXTERNAL ((FIX)->fx_subsy))
>      && TC_FORCE_RELOCATION (FIX)))
> 
> be a better default (or just
> (! SEG_NORMAL (SEG)
>  || (EXTERN_FORCE_RELOC
>      && (S_IS_EXTERNAL ((FIX)->fx_addsy)
> 	 || S_IS_EXTERNAL ((FIX)->fx_subsy))))
> ).

No, I tried something like that at one stage and ran into problems.
It seems that most people who write "sym1 - sym2", with both symbols
defined in the same local section, expect the assembler to perform
the subtraction regardless of whether sym1 or sym2 are global.

s390 really needs special treatment for its foo@PLT-bar.  When
looking at the assembly source, it is obvious that this expression
is different from (foo-bar)@PLT, but the latter is exactly what the
generic relocation code sees.

gas/ChangeLog
	* write.c (TC_FORCE_RELOCATION_SUB_SAME): Revert last change.
	* config/tc-s390.h (TC_FORCE_RELOCATION_SUB_SAME): Define.

Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.68
diff -u -p -r1.68 write.c
--- gas/write.c	23 Jan 2003 12:51:04 -0000	1.68
+++ gas/write.c	12 Feb 2003 22:56:38 -0000
@@ -51,7 +51,7 @@
 
 #ifndef TC_FORCE_RELOCATION_SUB_SAME
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG)	\
-  (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX))
+  (! SEG_NORMAL (SEG))
 #endif
 
 #ifndef TC_FORCE_RELOCATION_SUB_ABS
Index: gas/config/tc-s390.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-s390.h,v
retrieving revision 1.9
diff -u -p -r1.9 tc-s390.h
--- gas/config/tc-s390.h	5 Sep 2002 00:01:18 -0000	1.9
+++ gas/config/tc-s390.h	12 Feb 2003 22:56:38 -0000
@@ -32,6 +32,10 @@ struct fix;
 #define TC_FORCE_RELOCATION(FIX) tc_s390_force_relocation(FIX)
 extern int tc_s390_force_relocation PARAMS ((struct fix *));
 
+/* Don't resolve foo@PLT-bar to offset@PLT.  */
+#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG)	\
+  (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX))
+
 #define tc_fix_adjustable(X)  tc_s390_fix_adjustable(X)
 extern int tc_s390_fix_adjustable PARAMS ((struct fix *));
 
-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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