]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL.
authorJan Hubicka <jh@suse.cz>
Mon, 12 Feb 2001 16:45:23 +0000 (16:45 +0000)
committerJan Hubicka <jh@suse.cz>
Mon, 12 Feb 2001 16:45:23 +0000 (16:45 +0000)
* tc-i386.c (i386_displacement): Fix handling of
BFD_RELOC_X86_64_GOTPCREL.
(i386_validate_fix): Likewise.

bfd/ChangeLog
bfd/elf64-x86-64.c
gas/ChangeLog
gas/config/tc-i386.c

index 07e4679633d41123756ca85c4c110ada3ca5d69e..d93f918b36036b19328bf1f35ec087666ea11c57 100644 (file)
@@ -1,3 +1,7 @@
+Mon Feb 12 17:44:39 CET 2001  Jan Hubicka  <jh@suse.cz>
+
+       * elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL.
+
 2001-02-10  Nick Clifton  <nickc@redhat.com>
 
        * elf32-v850.c (v850_elf_reloc): Do not convert reloc addend to PC
index 27a97a29ef0739554008bb8f3092a9f3e133e1b4..70da7f73f506337a4717b155dd1bf71dc1d3473a 100644 (file)
@@ -45,7 +45,7 @@ static reloc_howto_type x86_64_elf_howto_table[] =
   HOWTO(R_X86_64_GLOB_DAT, 0,4,64,false,0,complain_overflow_bitfield,0,"R_X86_64_GLOB_DAT",false,MINUS_ONE ,MINUS_ONE ,false),
   HOWTO(R_X86_64_RELATIVE ,0,4,64,false,0,complain_overflow_bitfield,0,"R_X86_64_RELATIVE",false,MINUS_ONE ,MINUS_ONE ,false),
   HOWTO(R_X86_64_JUMP_SLOT,0,4,64,false,0,complain_overflow_bitfield,0,"R_X86_64_JUMP_SLOT",false,MINUS_ONE,MINUS_ONE ,false),
-  HOWTO(R_X86_64_GOTPCREL, 0,4,32,true, 0,complain_overflow_signed  ,0, "R_X86_64_PCREL",  false,0xffffffff,0xffffffff,true),
+  HOWTO(R_X86_64_GOTPCREL, 0,4,32,true, 0,complain_overflow_signed  ,0, "R_X86_64_GOTPCREL",false,0xffffffff,0xffffffff,true),
   HOWTO(R_X86_64_32,    0,4,32,false,0,complain_overflow_unsigned,0, "R_X86_64_32",     false,0xffffffff,0xffffffff,false),
   HOWTO(R_X86_64_32S,   0,4,32,false,0,complain_overflow_signed,  0, "R_X86_64_32S",    false,0xffffffff,0xffffffff,false),
   HOWTO(R_X86_64_16,    0,1,16,false,0,complain_overflow_bitfield,0, "R_X86_64_16",     false,0xffff    ,0xffff,    false),
index 46ba2f8f89bcd78186187aec4fa9cce30819a513..c397b5fcdc95d6d86f63e9c593177dc9a01e7d50 100644 (file)
@@ -1,3 +1,9 @@
+Mon Feb 12 17:44:08 CET 2001  Jan Hubicka  <jh@suse.cz>
+
+       * tc-i386.c (i386_displacement): Fix handling of
+       BFD_RELOC_X86_64_GOTPCREL.
+       (i386_validate_fix): Likewise.
+
 2001-02-09  David Mosberger  <davidm@hpl.hp.com>
 
        * config/tc-ia64.h (md_elf_section_type): New macro.
index f1e700631d58779aa32b09a983a6a2cc8b5fb2ab..c6e288e6941cfca8f8a82926e9a89678f2594826 100644 (file)
@@ -3436,7 +3436,10 @@ i386_displacement (disp_start, disp_end)
       assert (exp->X_op == O_symbol);
       exp->X_op = O_subtract;
       exp->X_op_symbol = GOT_symbol;
-      i.disp_reloc[this_operand] = BFD_RELOC_32;
+      if (i.disp_reloc[this_operand] == BFD_RELOC_X86_64_GOTPCREL)
+        i.disp_reloc[this_operand] = BFD_RELOC_32_PCREL;
+      else
+        i.disp_reloc[this_operand] = BFD_RELOC_32;
     }
 #endif
 
@@ -4600,9 +4603,18 @@ i386_validate_fix (fixp)
   if (fixp->fx_subsy && fixp->fx_subsy == GOT_symbol)
     {
       /* GOTOFF relocation are nonsense in 64bit mode.  */
-      if (flag_code == CODE_64BIT)
-       abort ();
-      fixp->fx_r_type = BFD_RELOC_386_GOTOFF;
+      if (fixp->fx_r_type == BFD_RELOC_32_PCREL)
+       {
+         if (flag_code != CODE_64BIT)
+           abort ();
+         fixp->fx_r_type = BFD_RELOC_X86_64_GOTPCREL;
+       }
+      else
+       {
+         if (flag_code == CODE_64BIT)
+           abort ();
+         fixp->fx_r_type = BFD_RELOC_386_GOTOFF;
+       }
       fixp->fx_subsy = 0;
     }
 }