OSDN Git Service

bfd/
authorJakub Jelinek <jakub@redhat.com>
Tue, 1 Oct 2002 09:10:45 +0000 (09:10 +0000)
committerJakub Jelinek <jakub@redhat.com>
Tue, 1 Oct 2002 09:10:45 +0000 (09:10 +0000)
* elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
to st_value + addend in non-code sections.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
R_X86_64_DTPOFF32 to st_value + addend in non-code sections.

ld/testsuite/
* ld-i386/i386.exp: Add tlsg test.
* ld-i386/tlsg.s: New test.
* ld-i386/tlsg.sd: New test.
* ld-i386/tlsbin.dd: Change LD into LD -> LE in comments.
* ld-i386/tlsbinpic.s: Likewise.
* ld-x86-64/x86-64.exp: Add tlsg test.
* ld-x86-64/tlsg.s: New test.
* ld-x86-64/tlsg.sd: New test.
* ld-x86-64/tlsbin.dd: Change LD into LD -> LE in comments.
* ld-x86-64/tlsbinpic.s: Likewise.

bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c

index f4fb4e0..9ce6779 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
+       to st_value + addend in non-code sections.
+       * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
+       R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
+
 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
             Ken Raeburn  <raeburn@cygnus.com>
             Aldy Hernandez  <aldyh@redhat.com>
index b71d78e..6bd277e 100644 (file)
@@ -2926,7 +2926,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
 
        case R_386_TLS_LDO_32:
-         if (info->shared)
+         if (info->shared || (input_section->flags & SEC_CODE) == 0)
            relocation -= dtpoff_base (info);
          else
            /* When converting LDO to LE, we must negate.  */
index fa2f2ee..2f92eae 100644 (file)
@@ -2496,7 +2496,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
 
        case R_X86_64_DTPOFF32:
-         if (info->shared)
+         if (info->shared || (input_section->flags & SEC_CODE) == 0)
            relocation -= dtpoff_base (info);
          else
            relocation = tpoff (info, relocation);