b9734f3572
* elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs. (elf32_sparc_rev32_howto): New variable. (sparc_reloc_map): Add TLS relocs. (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto): Handle REV32. (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject): New functions. (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry, struct elf32_sparc_link_hash_table): New structures. (elf32_sparc_tdata, elf32_sparc_local_got_tls_type, elf32_sparc_hash_table): Define. (link_hash_newfunc, elf32_sparc_link_hash_table_create, create_got_section, elf32_sparc_create_dynamic_sections, elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New functions. (elf32_sparc_check_relocs): Handle TLS relocs. Add dynamic reloc reference counting. (elf32_sparc_gc_sweep_hook): Likewise. (elf32_sparc_adjust_dynamic_symbol): Likewise. (elf32_sparc_size_dynamic_sections): Likewise. (elf32_sparc_relocate_section): Likewise. (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff): New functions. (elf32_sparc_object_p): Allocate backend private object data. (bfd_elf32_bfd_link_hash_table_create, elf_backend_copy_indirect_symbol, bfd_elf32_mkobject, elf_backend_can_refcount): Define. (elf_backend_create_dynamic_sections): Define to elf32_sparc_create_dynamic_sections. * reloc.c: Add SPARC TLS relocs. * bfd-in2.h, libbfd.h: Rebuilt. * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs. (sparc_reloc_map): Likewise. gas/ * config/tc-sparc.c (sparc_ip): Handle TLS % operators. (tc_gen_reloc): Handle TLS relocs. (sparc_cons, cons_fix_new_sparc): Handle %r_tls_dtpoff. * config/tc-sparc.h (tc_fix_adjustable): Don't adjust TLS relocs. * config/obj-elf.c (obj_elf_section_word): Handle tls. (obj_elf_type): Handle tls_object. include/ * elf/sparc.h: Add TLS relocs. Move R_SPARC_REV32 to 252. ld/testsuite/ * ld-sparc/sparc.exp: New. * ld-sparc/tlsg32.s: New test. * ld-sparc/tlsg32.sd: Likewise. * ld-sparc/tlsg64.s: Likewise. * ld-sparc/tlsg64.sd: Likewise. * ld-sparc/tlslib.s: Likewise. * ld-sparc/tlsnopic.s: Likewise. * ld-sparc/tlspic.s: Likewise. * ld-sparc/tlssunbin32.dd: Likewise. * ld-sparc/tlssunbin32.rd: Likewise. * ld-sparc/tlssunbin32.s: Likewise. * ld-sparc/tlssunbin32.sd: Likewise. * ld-sparc/tlssunbin32.td: Likewise. * ld-sparc/tlssunbin64.dd: Likewise. * ld-sparc/tlssunbin64.rd: Likewise. * ld-sparc/tlssunbin64.s: Likewise. * ld-sparc/tlssunbin64.sd: Likewise. * ld-sparc/tlssunbin64.td: Likewise. * ld-sparc/tlssunbinpic32.s: Likewise. * ld-sparc/tlssunbinpic64.s: Likewise. * ld-sparc/tlssunnopic32.dd: Likewise. * ld-sparc/tlssunnopic32.rd: Likewise. * ld-sparc/tlssunnopic32.s: Likewise. * ld-sparc/tlssunnopic32.sd: Likewise. * ld-sparc/tlssunnopic64.dd: Likewise. * ld-sparc/tlssunnopic64.rd: Likewise. * ld-sparc/tlssunnopic64.s: Likewise. * ld-sparc/tlssunnopic64.sd: Likewise. * ld-sparc/tlssunpic32.dd: Likewise. * ld-sparc/tlssunpic32.rd: Likewise. * ld-sparc/tlssunpic32.s: Likewise. * ld-sparc/tlssunpic32.sd: Likewise. * ld-sparc/tlssunpic32.td: Likewise. * ld-sparc/tlssunpic64.dd: Likewise. * ld-sparc/tlssunpic64.rd: Likewise. * ld-sparc/tlssunpic64.s: Likewise. * ld-sparc/tlssunpic64.sd: Likewise. * ld-sparc/tlssunpic64.td: Likewise.
81 lines
1.8 KiB
ArmAsm
81 lines
1.8 KiB
ArmAsm
.data
|
|
.align 4096
|
|
.section ".tbss"
|
|
.align 4
|
|
bl1: .word 0
|
|
bl2: .word 0
|
|
bl3: .word 0
|
|
bl4: .word 0
|
|
bl5: .word 0
|
|
.text
|
|
.align 4096
|
|
.globl fn3
|
|
.type fn3,#function
|
|
.proc 04
|
|
fn3:
|
|
save %sp, -160, %sp
|
|
.hidden _GLOBAL_OFFSET_TABLE_
|
|
sethi %hh(_GLOBAL_OFFSET_TABLE_), %l1
|
|
sethi %lm(_GLOBAL_OFFSET_TABLE_), %l2
|
|
or %l1, %hm(_GLOBAL_OFFSET_TABLE_), %l1
|
|
or %l2, %lo(_GLOBAL_OFFSET_TABLE_), %l2
|
|
sllx %l1, 32, %l1
|
|
add %l1, %l2, %l1
|
|
nop;nop;nop;nop
|
|
|
|
/* IE against global var */
|
|
sethi %tie_hi22(sg1), %o3
|
|
add %o3, %tie_lo10(sg1), %o3
|
|
ldx [%l1 + %o3], %o2, %tie_ldx(sg1)
|
|
add %g7, %o2, %o4, %tie_add(sg1)
|
|
nop;nop;nop;nop
|
|
|
|
/* direct %g7 access IE against global var */
|
|
sethi %tie_hi22(sg2), %o0
|
|
add %o0, %tie_lo10(sg2), %o0
|
|
ldx [%l1 + %o0], %o0, %tie_ldx(sg2)
|
|
lduw [%g7 + %o0], %o0, %tie_add(sg2)
|
|
nop;nop;nop;nop
|
|
|
|
/* IE against hidden var */
|
|
sethi %tie_hi22(sh1), %o0
|
|
add %o0, %tie_lo10(sh1), %o0
|
|
ldx [%l1 + %o0], %o0, %tie_ldx(sh1)
|
|
add %g7, %o0, %o0, %tie_add(sh1)
|
|
nop;nop;nop;nop
|
|
|
|
/* direct %g7 access IE against hidden var */
|
|
sethi %tie_hi22(sh2), %o5
|
|
add %o5, %tie_lo10(sh2), %o1
|
|
ldx [%l1 + %o1], %o2, %tie_ldx(sh2)
|
|
stb %o3, [%g7 + %o2], %tie_add(sh2)
|
|
nop;nop;nop;nop
|
|
|
|
/* IE against local var */
|
|
sethi %tie_hi22(bl1), %o0
|
|
add %o0, %tie_lo10(bl1), %o0
|
|
ldx [%l1 + %o0], %o0, %tie_ldx(bl1)
|
|
add %g7, %o0, %o0, %tie_add(bl1)
|
|
nop;nop;nop;nop
|
|
|
|
/* direct %g7 access IE against local var */
|
|
sethi %tie_hi22(bl2), %o5
|
|
add %o5, %tie_lo10(bl2), %o1
|
|
ldx [%l1 + %o1], %o2, %tie_ldx(bl2)
|
|
stb %o3, [%g7 + %o2], %tie_add(bl2)
|
|
nop;nop;nop;nop
|
|
|
|
/* LE, local var */
|
|
sethi %tle_hix22(bl3+1), %o2
|
|
xor %o2, %tle_lox10(bl3+1), %o4
|
|
add %g7, %o4, %o0
|
|
nop;nop;nop;nop
|
|
|
|
/* LE, hidden var, direct %g7 access */
|
|
sethi %tle_hix22(sh3), %o2
|
|
xor %o2, %tle_lox10(sh3), %o2
|
|
ld [%g7 + %o2], %o2
|
|
nop;nop;nop;nop
|
|
|
|
return %i7 + 8
|
|
nop
|