Add GLIBC_ABI_GNU_TLS version dependency only if ___tls_get_addr is
referenced by regular object.
bfd/
PR ld/33287
PR ld/33702
* elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set
has_tls_get_addr_call only if referenced by regular object.
ld/
PR ld/33287
PR ld/33702
* testsuite/ld-i386/i386.exp: Run PR ld/33702 test.
* testsuite/ld-i386/no-tls.c: New file.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
elf_x86_hash_entry (h)->tls_get_addr = 1;
}
- htab->has_tls_get_addr_call = 1;
+ if (h->ref_regular)
+ htab->has_tls_get_addr_call = 1;
}
/* Pass NULL for __ehdr_start which will be defined by
# The musl C library does not support --gnu-tls-tag nor --gnu2-tls-tag.
if { ![istarget *-*-musl]
+ && [istarget "i?86-*-linux*"]
&& [check_compiler_available] } {
run_cc_link_tests [list \
[list \
{{readelf {-W --version-info} gnu2-tls-1b.rd}} \
"gnu2-tls-1b.so" \
] \
+ [list \
+ "Build no-tls" \
+ "-Wl,--gnu-tls-tag,--gnu2-tls-tag" \
+ "" \
+ { no-tls.c } \
+ {{readelf {-W --version-info} gnu-tls-1b.rd} \
+ {readelf {-W --version-info} gnu2-tls-1b.rd}} \
+ "no-tls" \
+ ] \
]
}
--- /dev/null
+int
+main ()
+{
+ return 0;
+}