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: s390 fix for fix_adjustable.


On Wed, Nov 20, 2002 at 10:08:52AM +0100, Martin Schwidefsky wrote:
> 
> The ".long .LC0 - .LT0" relocation gets converted to a pc-relative relocation
> with an offset (R_390_PC32 .LC0+4). The "fixp->fx_offset != 0" is the culprit.

Actually, the truth is is that the fixup concerned hasn't had its
expression, ".LC0 - .LT0", converted to pcrel form at the time
adjust_reloc_syms runs.  You still have a subtraction of two symbols,
without any offset.  Thus your patch to the s390 back-end is covering
for a generic assembler bug.  eg. x86 shows the problem with the
following testcase.

	.section .rodata.str,"aMS",@progbits,1
.LC0:
	.string "abc"
.LC1:
	.string "c"

	.text
.LT0:
	.long	0
	.long	.LC0-.LT0

I'm applying the following patch, which should make your tc-s390.c
change unnecessary (but I'll leave reverting it to you!).

	* write.c (adjust_reloc_syms): Don't reduce SEC_MERGE fixups with
	fx_subsy non-NULL.

Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.63
diff -u -p -r1.63 write.c
--- gas/write.c	1 Nov 2002 10:42:25 -0000	1.63
+++ gas/write.c	20 Nov 2002 12:41:56 -0000
@@ -868,7 +868,8 @@ adjust_reloc_syms (abfd, sec, xxx)
 
 	/* Never adjust a reloc against local symbol in a merge section
 	   with non-zero addend.  */
-	if ((symsec->flags & SEC_MERGE) != 0 && fixp->fx_offset != 0)
+	if ((symsec->flags & SEC_MERGE) != 0
+	    && (fixp->fx_offset != 0 || fixp->fx_subsy != NULL))
 	  continue;
 
 	/* Never adjust a reloc against TLS local symbol.  */

-- 
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]