binutils-gdb/ld/testsuite/ld-sparc/tlssunbin64.rd

131 lines
4.3 KiB
Plaintext
Raw Normal View History

bfd/ * 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.
2003-01-25 00:44:45 +01:00
#source: tlssunbin64.s
#as: --64
#ld: -shared -melf64_sparc tmpdir/libtlslib64.so tmpdir/tlssunbinpic64.o
#readelf: -WSsrl
#target: sparc*-*-*
2005-08-15 17:39:48 +02:00
.*
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-14 00:29:36 +02:00
Section Headers:
+\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
+\[[ 0-9]+\] +NULL +0+ 0+ 0+ 00 +0 +0 +0
+\[[ 0-9]+\] .interp +.*
+\[[ 0-9]+\] .hash +.*
+\[[ 0-9]+\] .dynsym +.*
+\[[ 0-9]+\] .dynstr +.*
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
+\[[ 0-9]+\] .gnu.version +.*
+\[[ 0-9]+\] .gnu.version_r +.*
+\[[ 0-9]+\] .rela.dyn +.*
+\[[ 0-9]+\] .text +PROGBITS +0+101000 0+1000 0+11a4 00 +AX +0 +0 4096
+\[[ 0-9]+\] .tdata +PROGBITS +0+2021a4 0+21a4 0+0060 00 WAT +0 +0 +4
+\[[ 0-9]+\] .tbss +NOBITS +0+202204 0+2204 0+40 00 WAT +0 +0 +4
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
+\[[ 0-9]+\] .dynamic +DYNAMIC +0+202208 0+2208 0+130 10 +WA +4 +0 +8
+\[[ 0-9]+\] .got +PROGBITS +0+202338 0+2338 0+28 08 +WA +0 +0 +8
+\[[ 0-9]+\] .symtab +.*
+\[[ 0-9]+\] .strtab +.*
Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. bfd * elf.c (assign_section_numbers): Assign number for the .shstrtab section after the symbol table and string table sections. binutils * testsuite/binutils-all/readelf.s: Adjust expected ordering of sections. * testsuite/binutils-all/readelf.s-64: Likewise. gas * testsuite/gas/i386/ilp32/x86-64-unwind.d: Adjust expected ordering of sections. * testsuite/gas/i386/x86-64-unwind.d: Likewise. * testsuite/gas/ia64/alias-ilp32.d: Likewise. * testsuite/gas/ia64/alias.d: Likewise. * testsuite/gas/ia64/group-1.d: Likewise. * testsuite/gas/ia64/group-2.d: Likewise. * testsuite/gas/ia64/secname-ilp32.d: Likewise. * testsuite/gas/ia64/secname.d: Likewise. * testsuite/gas/ia64/unwind-ilp32.d: Likewise. * testsuite/gas/ia64/unwind.d: Likewise. * testsuite/gas/ia64/xdata-ilp32.d: Likewise. * testsuite/gas/ia64/xdata.d: Likewise. * testsuite/gas/mmix/bspec-1.d: Likewise. * testsuite/gas/mmix/bspec-2.d: Likewise. * testsuite/gas/mmix/byte-1.d: Likewise. * testsuite/gas/mmix/loc-1.d: Likewise. * testsuite/gas/mmix/loc-2.d: Likewise. * testsuite/gas/mmix/loc-3.d: Likewise. * testsuite/gas/mmix/loc-4.d: Likewise. * testsuite/gas/mmix/loc-5.d: Likewise. * testsuite/gas/tic6x/scomm-directive-4.d: Likewise. ld * testsuite/ld-alpha/tlsbin.rd: Adjust expected ordering of sections. * testsuite/ld-alpha/tlsbinr.rd: Likewise. * testsuite/ld-alpha/tlspic.rd: Likewise. * testsuite/ld-cris/libdso-2.d: Likewise. * testsuite/ld-i386/nogot1.d: Likewise. * testsuite/ld-i386/pr12718.d: Likewise. * testsuite/ld-i386/pr12921.d: Likewise. * testsuite/ld-i386/tlsbin-nacl.rd: Likewise. * testsuite/ld-i386/tlsbin.rd: Likewise. * testsuite/ld-i386/tlsbin2-nacl.rd: Likewise. * testsuite/ld-i386/tlsbin2.rd: Likewise. * testsuite/ld-i386/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsbindesc.rd: Likewise. * testsuite/ld-i386/tlsdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsdesc.rd: Likewise. * testsuite/ld-i386/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsgdesc.rd: Likewise. * testsuite/ld-i386/tlsnopic-nacl.rd: Likewise. * testsuite/ld-i386/tlsnopic.rd: Likewise. * testsuite/ld-i386/tlspic-nacl.rd: Likewise. * testsuite/ld-i386/tlspic.rd: Likewise. * testsuite/ld-i386/tlspic2-nacl.rd: Likewise. * testsuite/ld-i386/tlspic2.rd: Likewise. * testsuite/ld-ia64/tlsbin.rd: Likewise. * testsuite/ld-ia64/tlspic.rd: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-10.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-50.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-60.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-70.d: Likewise. * testsuite/ld-mmix/bspec1.d: Likewise. * testsuite/ld-mmix/bspec2.d: Likewise. * testsuite/ld-mmix/local1.d: Likewise. * testsuite/ld-mmix/local3.d: Likewise. * testsuite/ld-mmix/local5.d: Likewise. * testsuite/ld-mmix/local7.d: Likewise. * testsuite/ld-mmix/undef-3.d: Likewise. * testsuite/ld-powerpc/tlsexe.r: Likewise. * testsuite/ld-powerpc/tlsexe32.r: Likewise. * testsuite/ld-powerpc/tlsexetoc.r: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlsso32.r: Likewise. * testsuite/ld-powerpc/tlstocso.r: Likewise. * testsuite/ld-s390/tlsbin.rd: Likewise. * testsuite/ld-s390/tlsbin_64.rd: Likewise. * testsuite/ld-s390/tlspic.rd: Likewise. * testsuite/ld-s390/tlspic_64.rd: Likewise. * testsuite/ld-sh/sh64/crange1.rd: Likewise. * testsuite/ld-sh/sh64/crange2.rd: Likewise. * testsuite/ld-sh/sh64/crange3-cmpct.rd: Likewise. * testsuite/ld-sh/sh64/crange3-media.rd: Likewise. * testsuite/ld-sh/sh64/crange3.rd: Likewise. * testsuite/ld-sh/sh64/crangerel1.rd: Likewise. * testsuite/ld-sh/sh64/crangerel2.rd: Likewise. * testsuite/ld-sh/tlsbin-2.d: Likewise. * testsuite/ld-sh/tlspic-2.d: Likewise. * testsuite/ld-sparc/gotop32.rd: Likewise. * testsuite/ld-sparc/gotop64.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunnopic32.rd: Likewise. * testsuite/ld-sparc/tlssunnopic64.rd: Likewise. * testsuite/ld-sparc/tlssunpic32.rd: Likewise. * testsuite/ld-sparc/tlssunpic64.rd: Likewise. * testsuite/ld-tic6x/common.d: Likewise. * testsuite/ld-tic6x/shlib-1.rd: Likewise. * testsuite/ld-tic6x/shlib-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-noindex.rd: Likewise. * testsuite/ld-tic6x/static-app-1.rd: Likewise. * testsuite/ld-tic6x/static-app-1b.rd: Likewise. * testsuite/ld-tic6x/static-app-1r.rd: Likewise. * testsuite/ld-tic6x/static-app-1rb.rd: Likewise. * testsuite/ld-x86-64/ilp32-4-nacl.d: Likewise. * testsuite/ld-x86-64/ilp32-4.d: Likewise. * testsuite/ld-x86-64/nogot1.d: Likewise. * testsuite/ld-x86-64/pr12718.d: Likewise. * testsuite/ld-x86-64/pr12921.d: Likewise. * testsuite/ld-x86-64/split-by-file-nacl.rd: Likewise. * testsuite/ld-x86-64/split-by-file.rd: Likewise. * testsuite/ld-x86-64/tlsbin-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin.rd: Likewise. * testsuite/ld-x86-64/tlsbin2-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin2.rd: Likewise. * testsuite/ld-x86-64/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbindesc.rd: Likewise. * testsuite/ld-x86-64/tlsdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsdesc.rd: Likewise. * testsuite/ld-x86-64/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsgdesc.rd: Likewise. * testsuite/ld-x86-64/tlspic-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic.rd: Likewise. * testsuite/ld-x86-64/tlspic2-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic2.rd: Likewise. * testsuite/ld-xtensa/tlsbin.rd: Likewise. * testsuite/ld-xtensa/tlspic.rd: Likewise.
2016-08-19 10:16:30 +02:00
+\[[ 0-9]+\] .shstrtab +.*
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-14 00:29:36 +02:00
#...
Elf file type is EXEC \(Executable file\)
Entry point 0x102000
There are [0-9]+ program headers, starting at offset [0-9]+
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-14 00:29:36 +02:00
Program Headers:
+Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+PHDR +0x0+40 0x0+100040 0x0+100040 0x0+150 0x0+150 R +0x8
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-14 00:29:36 +02:00
+INTERP +0x0+190 0x0+100190 0x0+100190 0x0+19 0x0+19 R +0x1
.*Requesting program interpreter.*
2005-08-15 17:39:48 +02:00
+LOAD .* R E 0x100000
+LOAD .* RW +0x100000
+DYNAMIC .* RW +0x8
+TLS .* 0x0+60 0x0+a0 R +0x4
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-14 00:29:36 +02:00
#...
Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
2005-08-15 17:39:48 +02:00
[0-9a-f ]+R_SPARC_TLS_TPOFF64 +0+ +sG5 \+ 0
[0-9a-f ]+R_SPARC_TLS_TPOFF64 +0+ +sG2 \+ 0
[0-9a-f ]+R_SPARC_TLS_TPOFF64 +0+ +sG6 \+ 0
[0-9a-f ]+R_SPARC_TLS_TPOFF64 +0+ +sG1 \+ 0
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-14 00:29:36 +02:00
Symbol table '\.dynsym' contains [0-9]+ entries:
+Num: +Value +Size +Type +Bind +Vis +Ndx +Name
2005-08-15 17:39:48 +02:00
.* NOTYPE +LOCAL +DEFAULT +UND *
.* TLS +GLOBAL +DEFAULT +UND sG5
.* TLS +GLOBAL +DEFAULT +UND sG2
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr@SUNWprivate_1.1 \(2\)
.* TLS +GLOBAL +DEFAULT +UND sG6
.* TLS +GLOBAL +DEFAULT +UND sG1
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-14 00:29:36 +02:00
Symbol table '\.symtab' contains [0-9]+ entries:
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-14 00:29:36 +02:00
+Num: +Value +Size Type +Bind +Vis +Ndx Name
2005-08-15 17:39:48 +02:00
.* NOTYPE +LOCAL +DEFAULT +UND *
.* SECTION +LOCAL +DEFAULT +1 *
.* SECTION +LOCAL +DEFAULT +2 *
.* SECTION +LOCAL +DEFAULT +3 *
.* SECTION +LOCAL +DEFAULT +4 *
.* SECTION +LOCAL +DEFAULT +5 *
.* SECTION +LOCAL +DEFAULT +6 *
.* SECTION +LOCAL +DEFAULT +7 *
.* SECTION +LOCAL +DEFAULT +8 *
.* SECTION +LOCAL +DEFAULT +9 *
.* SECTION +LOCAL +DEFAULT +10 *
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* SECTION +LOCAL +DEFAULT +11 *
.* SECTION +LOCAL +DEFAULT +12 *
.* FILE +LOCAL +DEFAULT +ABS .*
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* TLS +LOCAL +DEFAULT +9 sl1
.* TLS +LOCAL +DEFAULT +9 sl2
.* TLS +LOCAL +DEFAULT +9 sl3
.* TLS +LOCAL +DEFAULT +9 sl4
.* TLS +LOCAL +DEFAULT +9 sl5
.* TLS +LOCAL +DEFAULT +9 sl6
.* TLS +LOCAL +DEFAULT +9 sl7
.* TLS +LOCAL +DEFAULT +9 sl8
.* FILE +LOCAL +DEFAULT +ABS .*
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* TLS +LOCAL +DEFAULT +10 bl1
.* TLS +LOCAL +DEFAULT +10 bl2
.* TLS +LOCAL +DEFAULT +10 bl3
.* TLS +LOCAL +DEFAULT +10 bl4
.* TLS +LOCAL +DEFAULT +10 bl5
.* TLS +LOCAL +DEFAULT +10 bl6
.* TLS +LOCAL +DEFAULT +10 bl7
.* TLS +LOCAL +DEFAULT +10 bl8
.* FILE +LOCAL +DEFAULT +ABS .*
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* OBJECT +LOCAL +DEFAULT +11 _DYNAMIC
.* OBJECT +LOCAL +DEFAULT +12 _PROCEDURE_LINKAGE_TABLE_
.* OBJECT +LOCAL +DEFAULT +12 _GLOBAL_OFFSET_TABLE_
.* TLS +GLOBAL +DEFAULT +9 sg8
.* TLS +GLOBAL +DEFAULT +10 bg8
.* TLS +GLOBAL +DEFAULT +10 bg6
.* TLS +GLOBAL +DEFAULT +UND sG5
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* TLS +GLOBAL +DEFAULT +10 bg3
.* TLS +GLOBAL +DEFAULT +9 sg3
.* TLS +GLOBAL +HIDDEN +9 sh3
.* TLS +GLOBAL +DEFAULT +UND sG2
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* TLS +GLOBAL +DEFAULT +9 sg4
.* TLS +GLOBAL +DEFAULT +9 sg5
.* TLS +GLOBAL +DEFAULT +10 bg5
.* TLS +GLOBAL +HIDDEN +9 sh7
.* TLS +GLOBAL +HIDDEN +9 sh8
.* TLS +GLOBAL +DEFAULT +9 sg1
.* FUNC +GLOBAL +DEFAULT +8 _start
.* TLS +GLOBAL +HIDDEN +9 sh4
.* TLS +GLOBAL +DEFAULT +10 bg7
.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr@@SUNWprivate_1.1
.* TLS +GLOBAL +HIDDEN +9 sh5
.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start
.* TLS +GLOBAL +DEFAULT +UND sG6
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* FUNC +GLOBAL +DEFAULT +8 fn2
.* TLS +GLOBAL +DEFAULT +9 sg2
.* TLS +GLOBAL +DEFAULT +UND sG1
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-25 12:16:06 +01:00
.* TLS +GLOBAL +HIDDEN +9 sh1
.* TLS +GLOBAL +DEFAULT +9 sg6
.* TLS +GLOBAL +DEFAULT +9 sg7
.* NOTYPE +GLOBAL +DEFAULT +12 _edata
.* NOTYPE +GLOBAL +DEFAULT +12 _end
.* TLS +GLOBAL +HIDDEN +9 sh2
.* TLS +GLOBAL +HIDDEN +9 sh6
.* TLS +GLOBAL +DEFAULT +10 bg2
.* TLS +GLOBAL +DEFAULT +10 bg1
.* TLS +GLOBAL +DEFAULT +10 bg4