binutils-gdb/ld/testsuite/ld-powerpc/tlsmark.s

47 lines
555 B
ArmAsm
Raw Normal View History

include/elf/ * ppc.h (R_PPC_TLSGD, R_PPC_TLSLD): Add new relocs. * ppc64.h (R_PPC64_TLSGD, R_PPC64_TLSLD): Add new relocs. bfd/ * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New. * section.c (struct bfd_section): Add has_tls_get_addr_call. (BFD_FAKE_SECTION): Init new flag. * ecoff.c (bfd_debug_section): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD. (ppc_elf_reloc_type_lookup): Handle new relocs. (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such without marker relocs. (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs if section has no old-style calls. (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too. Don't try to optimize new-style __tls_get_addr call when handling arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD relocs. * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD. (ppc64_elf_reloc_type_lookup): Handle new relocs. (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such without marker relocs. (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs if section has no old-style calls. Set toc_ref for new relocs as appropriate. (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too. Don't try to optimize new-style __tls_get_addr call when handling arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD relocs. gas/ * config/tc-ppc.c (ppc_elf_suffix): Error if ppc32 tls got relocs have non-zero addend. (md_assemble): Parse args of __tls_get_addr calls. (md_apply_fix): Handle BFD_RELOC_PPC_TLSGD and BFD_RELOC_PPC_TLSLD. ld/testsuite/ * ld-powerpc/tlsmark.s, * ld-powerpc/tlsmark.d: New test. * ld-powerpc/tlsmark32.s, * ld-powerpc/tlsmark32.d: New test. * ld-powerpc/powerpc.exp: Run them.
2009-03-04 13:50:50 +08:00
.section ".tdata","awT",@progbits
x: .int 1
y: .int 2
.section ".toc","aw",@progbits
.p2align 3
.LC0:
.quad y@dtpmod
.quad y@dtprel
.LC1:
.quad y@dtpmod
.quad 0
.text
.global _start
_start:
b .L2
.L1:
bl __tls_get_addr(x@tlsgd)
nop
ld 4,0(3)
addi 3,2,x@got@tlsld
b .L3
.L2:
addi 3,2,x@got@tlsgd
b .L1
.L3:
bl __tls_get_addr(x@tlsld)
nop
ld 4,x@dtprel(3)
addi 3,2,.LC0@toc
b .L5
.L4:
addi 3,2,.LC1@toc
b .L6
.L5:
bl .__tls_get_addr(.LC0@tlsgd)
nop
ld 5,0(3)
b .L4
.L6:
bl .__tls_get_addr(.LC1@tlsld)
nop
ld 5,y@dtprel(3)