bfd/ChangeLog:
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 17 Mar 2006 06:44:37 +0000 (06:44 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Fri, 17 Mar 2006 06:44:37 +0000 (06:44 +0000)
* elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
first relocation to the second when relaxing TLS GD to LE;
zero it out when relaxing to IE.
ld/testsuite/ChangeLog:
* ld-powerpc/tls32.s: Verify that +32768 @plt addend is
discarded.

bfd/ChangeLog
bfd/elf32-ppc.c
ld/testsuite/ChangeLog
ld/testsuite/ld-powerpc/tls32.s

index 5b8d908621044694aee74e1daa33a7e7a66206cf..794f18f1226f34dcbedc26fa077bcfbe3045031b 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-17  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
+       first relocation to the second when relaxing TLS GD to LE;
+       zero it out when relaxing to IE.
+
 2006-03-17  Alan Modra  <amodra@bigpond.net.au>
 
        PR 2434
index 2fd30a0560b716eb274ef0838176b4dd186ff59f..6a2d5170d78d5a9b94a236ac7ff8a4cbb945879c 100644 (file)
@@ -5768,6 +5768,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
                      insn1 |= 32 << 26;        /* lwz */
                      insn2 = 0x7c631214;       /* add 3,3,2 */
                      rel[1].r_info = ELF32_R_INFO (r_symndx2, R_PPC_NONE);
+                     rel[1].r_addend = 0;
                      r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3)
                                + R_PPC_GOT_TPREL16);
                      rel->r_info = ELF32_R_INFO (r_symndx, r_type);
@@ -5782,13 +5783,13 @@ ppc_elf_relocate_section (bfd *output_bfd,
                          /* Was an LD reloc.  */
                          r_symndx = 0;
                          rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
-                         rel[1].r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
                        }
                      r_type = R_PPC_TPREL16_HA;
                      rel->r_info = ELF32_R_INFO (r_symndx, r_type);
                      rel[1].r_info = ELF32_R_INFO (r_symndx,
                                                    R_PPC_TPREL16_LO);
                      rel[1].r_offset += 2;
+                     rel[1].r_addend = rel->r_addend;
                    }
                  bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
                  bfd_put_32 (output_bfd, insn2, contents + offset);
index a9f13571d6b65f606c92741f147b91e495039133..f968b4ce1783319206cf5f1380d8d6c8e8b131ac 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-17  Alexandre Oliva  <aoliva@redhat.com>
+
+       * ld-powerpc/tls32.s: Verify that +32768 @plt addend is
+       discarded.
+
 2006-03-14  Richard Sandiford  <richard@codesourcery.com>
 
        * ld-mips/emit-relocs-1a.s, ld-mips/emit-relocs-1b.s,
index b8d0e3d11cf996714f753f374bbe3307ff6c419c..1c3092d5d2ee95e6c296c0f2897dfb706a20a287 100644 (file)
@@ -33,11 +33,11 @@ _start:
 #global syms
 #GD
  addi 3,31,gd0@got@tlsgd       #R_PPC_GOT_TLSGD16      gd0
- bl __tls_get_addr@plt         #R_PPC_PLTREL24         __tls_get_addr
+ bl __tls_get_addr+0x8000@plt  #R_PPC_PLTREL24         __tls_get_addr
 
 #LD
  addi 3,31,ld0@got@tlsld       #R_PPC_GOT_TLSLD16      ld0
- bl __tls_get_addr@plt         #R_PPC_PLTREL24         __tls_get_addr
+ bl __tls_get_addr+0x8000@plt  #R_PPC_PLTREL24         __tls_get_addr
 
  addi 9,3,ld0@dtprel           #R_PPC_DTPREL16         ld0