mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
3c5038247c
This patch adds support for TLS relocation targeting C_HIDEXT symbols. In gas, TLS relocations, except R_TLSM and R_TLMSL, must keep the value of their target symbol. In ld, it simply ensures that internal TLS symbols are added to the linker hash table for xcoff_reloc_type_tls. It also improves the tests made by both. bfd/ChangeLog: * coff-rs6000.c (xcoff_howto_table): Fix name of R_TLSML. (xcoff_reloc_type_tls): Replace the error when h is NULL by an assert. (xcoff_complain_overflow_unsigned_func): Adjust comments. * coff64-rs6000.c (xcoff64_howto_table): Fix name of R_TLSML. * xcofflink.c (xcoff_link_add_symbols_to_hash_table): New function. (xcoff_link_add_symbols): Add C_HIDEXT TLS symbols to the linker hash table. gas/ChangeLog: * config/tc-ppc.c (md_apply_fix): Enable support for TLS relocation over internal symbols. * testsuite/gas/ppc/aix.exp: Replace xcoff-tlms by xcoff-tls. * testsuite/gas/ppc/xcoff-tlsm-32.d: Removed. * testsuite/gas/ppc/xcoff-tlsm-64.d: Removed. * testsuite/gas/ppc/xcoff-tlsm.s: Removed. * testsuite/gas/ppc/xcoff-tls-32.d: New test. * testsuite/gas/ppc/xcoff-tls-64.d: New test. * testsuite/gas/ppc/xcoff-tls.s: New test. ld/ChangeLog: * testsuite/ld-powerpc/aix52.exp: Improve aix-tls-reloc test. * testsuite/ld-powerpc/aix-tls-reloc.s: Likewise. * testsuite/ld-powerpc/aix-tls-reloc-32.d: Removed. * testsuite/ld-powerpc/aix-tls-reloc-64.d: Removed. * testsuite/ld-powerpc/aix-tls-reloc-32.dd: New test. * testsuite/ld-powerpc/aix-tls-reloc-32.dt: New test. * testsuite/ld-powerpc/aix-tls-reloc-64.dd: New test. * testsuite/ld-powerpc/aix-tls-reloc-64.dt: New test.
120 lines
1.8 KiB
Plaintext
120 lines
1.8 KiB
Plaintext
#source: aix-tls-reloc.s
|
|
#as: -a64
|
|
#ld: -b64 -shared -bE:aix-tls-reloc.ex
|
|
#objdump: -dr -j.data
|
|
#target: [is_xcoff_format]
|
|
|
|
.*
|
|
|
|
|
|
Disassembly of section .data:
|
|
|
|
.* <foo>:
|
|
.*
|
|
.*
|
|
.*
|
|
.*
|
|
.*
|
|
.*
|
|
.*
|
|
|
|
.* <TOC>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS tdata_ext.*
|
|
.*: ff ff 88 00 .*
|
|
|
|
.* <.tdata_ext_gd>:
|
|
...
|
|
.*: R_TLSM tdata_ext.*
|
|
|
|
.*<tdata_ext_ld>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LD tdata_ext.*
|
|
.*: ff ff 88 00 .*
|
|
|
|
.* <tdata_ext_ie>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_IE tdata_ext.*
|
|
.*: ff ff 88 00 .*
|
|
|
|
.* <tdata_ext_le>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LE tdata_ext.*
|
|
.*: ff ff 88 00 .*
|
|
|
|
.* <tdata_int1_gd>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS tdata_int_csect.*
|
|
.*: ff ff 88 04 .*
|
|
|
|
.* <.tdata_int1_gd>:
|
|
...
|
|
.*: R_TLSM tdata_int_csect.*
|
|
|
|
.* <tdata_int1_ld>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LD tdata_int_csect.*
|
|
.*: ff ff 88 04 .*
|
|
|
|
.* <tdata_int1_ie>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_IE tdata_int_csect.*
|
|
.*: ff ff 88 04 .*
|
|
|
|
.* <tdata_int1_le>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LE tdata_int_csect.*
|
|
.*: ff ff 88 04 .*
|
|
|
|
.* <tdata_int2_gd>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS tdata_int_csect.*
|
|
.*: ff ff 88 08 .*
|
|
|
|
.* <.tdata_int2_gd>:
|
|
...
|
|
.*: R_TLSM tdata_int_csect.*
|
|
|
|
.* <tdata_int2_ld>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LD tdata_int_csect.*
|
|
.*: ff ff 88 08 .*
|
|
|
|
.* <tdata_int2_ie>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_IE tdata_int_csect.*
|
|
.*: ff ff 88 08 .*
|
|
|
|
.* <tdata_int2_le>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LE tdata_int_csect.*
|
|
.*: ff ff 88 08 .*
|
|
|
|
.* <tbss_ext_gd>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS tbss_ext.*
|
|
.*: ff ff 88 10 .*
|
|
|
|
.* <.tbss_ext_gd>:
|
|
...
|
|
.*: R_TLSM tbss_ext.*
|
|
|
|
.* <tbss_ext_ld>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LD tbss_ext.*
|
|
.*: ff ff 88 10 .*
|
|
|
|
.* <tbss_ext_ie>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_IE tbss_ext.*
|
|
.*: ff ff 88 10 .*
|
|
|
|
.* <tbss_ext_le>:
|
|
.*: ff ff ff ff .*
|
|
.*: R_TLS_LE tbss_ext.*
|
|
.*: ff ff 88 10 .*
|
|
|
|
.* <_\$TLSML>:
|
|
...
|
|
.*: R_TLSML _\$TLSML.*
|