This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix i386 @NTPOFF and @DTPOFF with addend
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: rth at redhat dot com, drepper at redhat dot com, roland at redhat dot com
- Date: Tue, 10 Sep 2002 23:55:26 +0200
- Subject: [PATCH] Fix i386 @NTPOFF and @DTPOFF with addend
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
gcc generates code like:
movl %gs:0, %eax
cmpl $231, x@NTPOFF+8(%eax)
for non-pic code on IA-32, but gas silently ignores the addend.
The following patch seems to fix it.
Ok to commit?
2002-09-10 Jakub Jelinek <jakub@redhat.com>
* config/tc-i386.c (md_apply_fix3): Allow addend for
BFD_RELOC_386_TLS_LDO_32 and BFD_RELOC_386_TLS_LE.
For BFD_RELOC_386_TLS_LE_32, negate addend.
--- gas/config/tc-i386.c.jj 2002-09-10 14:50:57.000000000 +0200
+++ gas/config/tc-i386.c 2002-09-10 16:10:34.000000000 +0200
@@ -4657,14 +4657,15 @@ md_apply_fix3 (fixP, valP, seg)
case BFD_RELOC_386_GOT32:
case BFD_RELOC_386_TLS_GD:
case BFD_RELOC_386_TLS_LDM:
- case BFD_RELOC_386_TLS_LDO_32:
case BFD_RELOC_386_TLS_IE_32:
- case BFD_RELOC_386_TLS_LE_32:
- case BFD_RELOC_386_TLS_LE:
case BFD_RELOC_X86_64_GOT32:
value = 0; /* Fully resolved at runtime. No addend. */
break;
+ case BFD_RELOC_386_TLS_LE_32:
+ value = -value;
+ break;
+
case BFD_RELOC_VTABLE_INHERIT:
case BFD_RELOC_VTABLE_ENTRY:
fixP->fx_done = 0;
Jakub