binutils-gdb/ld/testsuite/ld-sparc/tlssunnopic64.dd
Jakub Jelinek 40937810e1 2005-04-14 David S. Miller <davem@davemloft.net>
bfd/
	Add TLS support for 64-bit Sparc ELF.
	*  elf64-sparc.c (sparc64_elf_dyn_relocs,
	sparc64_elf_link_hash_entry, sparc64_elf_obj_tdata): New structs.
	(GOT_UNKNOWN, GOT_NORMAL, GOT_TLD_GD, GOT_TLD_IE,
	sparc64_elf_hash_entry, sparc64_elf_tdata,
	sparc64_elf_local_got_tls_type): New defines.
	(sparc64_elf_mkobject): New function.
	(sparc64_elf_link_hash_table): Add members for dynamic linker
	sections PLT, RELPLT, DYNBSS, and RELBSS.  Add tls_ldm_got
	uion to track TLS GOT references.  Add sym_sec to cache
	mappings from local sym to section.
	(link_hash_newfunc): New function.
	(sparc64_elf_bfd_link_hash_table_create): Rename to
	sparc64_elf_link_hash_table_create for consistency.
	Pass link_hash_newfunc to _bfd_elf_link_hash_table_init.
	(sparc64_elf_create_dynamic_sections): Initialize new section
	members of sparc64_elf_link_hash_table.  Only init srelbss
	if not-shared.
	(sparc64_elf_copy_indirect_symbol, sparc64_elf_tls_transition):
	New functions.
	(SPARC_NOP): Define.
	(sparc64_elf_build_plt, sparc64_elf_plt_entry_offset,
	sparc64_elf_plt_ptr_offset): Delete.
	(sparc64_plt_entry_build): New function to build PLT entries
	gradually instread of all at once at the end of linking.
	(sparc64_elf_check_relocs): Delete dynobj, sgot, and srelgot
	local vars.  Get them from sparc64_elf_hash_table instead.
	Check early on if r_symndx is in bounds.  Handle TLS transitions.
	Account for TLS GOT references and DF_STATIC_TLS, as needed.
	For TLS relocs, record the tls_type in either
	sparc64_elf_local_got_tls_type or sparc64_elf_hash_entry as
	appropriate.  For R_SPARC_TLS_{GD,LDM}_CALL, emit a reference
	to the __tls_get_addr symbol.  For PLT relocs, track references
	via h->plt.refcount.  When R_SPARC_{PC10,PC22,PC_HH22,PC_HM10,
	PC_LM22} and h not-NULL, set h->non_got_ref.  For global data
	symbol references, count the number of relocations needed for
	that symbol.  For default switch case, don't error, this lets
	the TLS relocs not explicitly handled by this function get
	accepted.
	(sparc64_elf_gc_mark_hook, sparc64_gc_sweep_hook): New functions.
	(sparc64_elf_adjust_dynamic_symbol): Remove dynobj local var, get
	it from sparc64_elf_hash_table.  Store the real PLT offset
	in h->plt.offset, and build PLT entries one at a time.  Also
	get .dynbss section pointer from htab.
	(allocate_dynrelocs, readonly_dynrelocs,
	sparc64_omit_section_dynsym): New functions.
	(sparc64_elf_omit_section_dynsym): Use these new functions as
	helpers.
	(dtpoff_base, tpoff): New functions.
	(sparc64_elf_relocate_section): Kill dynobj, sgot, and splt
	locals, get them from sparc64_elf_hash_table.  Handle TLS
	relocations and refcounting in main relocation loop.
	(sparc64_elf_finish_dynamic_symbol): Use
	sparc64_elf_link_hash_table.  Build PLT entries as we see
	them.  Handle TLS GOT relocations.
	(sparc64_elf_finish_dynamic_sections): Get sgot and dynobj
	from sparc64_elf_hash_table.  Initialize only PLT header
	not all entries since we not build PLT entries one by one.
	(elf_backend_copy_indirect_symbol, bfd_elf64_mkobject,
	elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook,
	elf_backend_can_gc_sections, elf_backend_can_refcount): Define.
ld/testsuite/
	* ld-selective/sel-dump.exp: Do not exclude sparc64-*.
	* ld-selective/selective.exp: Likewise.
	* ld-sparc/sparc.exp: Add {32,64}-bit prefix to test
	names so we know which one is failing.  Run sparc64 TLS
	tests on multi-arch sparc platforms.
	* ld-sparc/tls64.sd, ld-sparc/tlssunbin64.dd,
	ld-sparc/tlssunbin64.rd, ld/testsuite/ld-sparc/tlssunbin64.sd,
	ld-sparc/tlssunbin64.td, ld-sparc/tlssunnopic64.dd,
	ld-sparc/tlssunnopic64.rd, ld-sparc/tlssunnopic64.sd,
	ld-sparc/tlssunpic64.dd, ld-sparc/tlssunpic64.rd,
	ld-sparc/tlssunpic64.sd, ld-sparc/tlssunpic64.td): Update now
	that sparc64 ELF does support TLS.
2005-04-13 22:29:36 +00:00

89 lines
2.8 KiB
Plaintext

#source: tlssunnopic64.s
#source: tlsnopic.s
#as: --64 -Av9
#ld: -shared -melf64_sparc
#objdump: -drj.text
#target: isparc-*-*
.*: +file format elf64-sparc
Disassembly of section .text:
0+1000 <fn3>:
+1000: 9d e3 bf 60 save %sp, -160, %sp
+1004: 23 00 00 00 sethi %hi\(0\), %l1
+1008: 25 00 00 00 sethi %hi\(0\), %l2
+100c: a2 14 60 00 mov %l1, %l1
+1010: a4 14 a0 00 mov %l2, %l2
+1014: a3 2c 70 20 sllx %l1, 0x20, %l1
+1018: a2 04 40 12 add %l1, %l2, %l1
+101c: 01 00 00 00 nop *
+1020: 01 00 00 00 nop *
+1024: 01 00 00 00 nop *
+1028: 01 00 00 00 nop *
+102c: 17 00 00 00 sethi %hi\(0\), %o3
+1030: 96 02 e0 18 add %o3, 0x18, %o3 ! 18 <.*>
+1034: d4 5c 40 0b ldx \[ %l1 \+ %o3 \], %o2
+1038: 98 01 c0 0a add %g7, %o2, %o4
+103c: 01 00 00 00 nop *
+1040: 01 00 00 00 nop *
+1044: 01 00 00 00 nop *
+1048: 01 00 00 00 nop *
+104c: 11 00 00 00 sethi %hi\(0\), %o0
+1050: 90 02 20 20 add %o0, 0x20, %o0 ! 20 <.*>
+1054: d0 5c 40 08 ldx \[ %l1 \+ %o0 \], %o0
+1058: d0 01 c0 08 ld \[ %g7 \+ %o0 \], %o0
+105c: 01 00 00 00 nop *
+1060: 01 00 00 00 nop *
+1064: 01 00 00 00 nop *
+1068: 01 00 00 00 nop *
+106c: 11 00 00 00 sethi %hi\(0\), %o0
+1070: 90 02 20 28 add %o0, 0x28, %o0 ! 28 <.*>
+1074: d0 5c 40 08 ldx \[ %l1 \+ %o0 \], %o0
+1078: 90 01 c0 08 add %g7, %o0, %o0
+107c: 01 00 00 00 nop *
+1080: 01 00 00 00 nop *
+1084: 01 00 00 00 nop *
+1088: 01 00 00 00 nop *
+108c: 1b 00 00 00 sethi %hi\(0\), %o5
+1090: 92 03 60 30 add %o5, 0x30, %o1 ! 30 <.*>
+1094: d4 5c 40 09 ldx \[ %l1 \+ %o1 \], %o2
+1098: d6 29 c0 0a stb %o3, \[ %g7 \+ %o2 \]
+109c: 01 00 00 00 nop *
+10a0: 01 00 00 00 nop *
+10a4: 01 00 00 00 nop *
+10a8: 01 00 00 00 nop *
+10ac: 11 00 00 00 sethi %hi\(0\), %o0
+10b0: 90 02 20 08 add %o0, 8, %o0 ! 8 <.*>
+10b4: d0 5c 40 08 ldx \[ %l1 \+ %o0 \], %o0
+10b8: 90 01 c0 08 add %g7, %o0, %o0
+10bc: 01 00 00 00 nop *
+10c0: 01 00 00 00 nop *
+10c4: 01 00 00 00 nop *
+10c8: 01 00 00 00 nop *
+10cc: 1b 00 00 00 sethi %hi\(0\), %o5
+10d0: 92 03 60 10 add %o5, 0x10, %o1 ! 10 <.*>
+10d4: d4 5c 40 09 ldx \[ %l1 \+ %o1 \], %o2
+10d8: d6 29 c0 0a stb %o3, \[ %g7 \+ %o2 \]
+10dc: 01 00 00 00 nop *
+10e0: 01 00 00 00 nop *
+10e4: 01 00 00 00 nop *
+10e8: 01 00 00 00 nop *
+10ec: 15 00 00 00 sethi %hi\(0\), %o2
+10f0: 98 1a a0 00 xor %o2, 0, %o4
+10f4: 90 01 c0 0c add %g7, %o4, %o0
+10f8: 01 00 00 00 nop *
+10fc: 01 00 00 00 nop *
+1100: 01 00 00 00 nop *
+1104: 01 00 00 00 nop *
+1108: 15 00 00 00 sethi %hi\(0\), %o2
+110c: 94 1a a0 00 xor %o2, 0, %o2
+1110: d4 01 c0 0a ld \[ %g7 \+ %o2 \], %o2
+1114: 01 00 00 00 nop *
+1118: 01 00 00 00 nop *
+111c: 01 00 00 00 nop *
+1120: 01 00 00 00 nop *
+1124: 81 cf e0 08 rett %i7 \+ 8
+1128: 01 00 00 00 nop *
#pass