bfd/ChangeLog:

* 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.
This commit is contained in:
Alexandre Oliva 2006-03-17 06:44:37 +00:00
parent 2de922512d
commit e1710606c9
4 changed files with 15 additions and 3 deletions

View 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

View 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);

View 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,

View 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