[PATCH] Fix i386 @NTPOFF and @DTPOFF with addend

Jakub Jelinek jakub@redhat.com
Tue Sep 10 14:55:00 GMT 2002


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



More information about the Binutils mailing list