mirror of
https://github.com/bminor/binutils-gdb.git
synced 2026-02-05 03:31:29 +00:00
On Linux/x86, programs and shared libraries compiled with -mtls-dialect=gnu2 may fail silently at run-time against glibc without the GNU2 TLS run-time fixes for: https://sourceware.org/bugzilla/show_bug.cgi?id=31501 https://sourceware.org/bugzilla/show_bug.cgi?id=31372 A version tag, GLIBC_ABI_GNU2_TLS, has been added to glibc to indicate that glibc has the working GNU2 TLS run-time. Add the --gnu2-tls-tag option to i386/x86-64 ELF linker to add the GLIBC_ABI_GNU2_TLS version dependency in output programs and shared libraries when linking against glibc if input relocatable object files have R_386_TLS_DESC_CALL or R_X86_64_TLSDESC_CALL relocation. The output will fail to load and run at run-time against glibc which doesn't define the GLIBC_ABI_GNU2_TLS version. Add the --enable-gnu2-tls-tag configure option to enable --gnu2-tls-tag by default. If unspecified, linker will add the GLIBC_ABI_GNU2_TLS version dependency if input object files have R_386_TLS_DESC_CALL or R_X86_64_TLSDESC_CALL relocation and libc.so defines the GLIBC_ABI_GNU2_TLS version. Update elf_link_add_glibc_verneed to properly add the GLIBC_2.36 version dependency when -z mark-plt -z nopack-relative-relocs passed to x86-64 ELF linker. bfd/ PR ld/33130 * elf-bfd.h (_bfd_elf_link_add_glibc_version_dependency): Add a pointer to bool argument. * elf-linker-x86.h (elf_linker_x86_params): Add gnu2_tls_version_tag. * elf32-i386.c (elf_i386_scan_relocs): Set has_tls_desc_call to 1 for R_386_TLS_DESC_CALL. (elf_i386_add_glibc_version_dependency): New. Undef before FreeBSD support. * elf64-x86-64.c (elf_x86_64_scan_relocs): Set has_tls_desc_call to 1 for R_X86_64_TLSDESC_CALL. (elf_x86_64_add_glibc_version_dependency): Add GLIBC_ABI_GNU2_TLS version dependency if GLIBC_ABI_GNU2_TLS dependency isn't disabled and has_tlsdesc_call isn't 0. (elf_backend_add_glibc_version_dependency): Undef before FreeBSD support and redefine for elf32-x86-64. * elflink.c (elf_link_add_glibc_verneed): Changed to return bool. Remove the pointer to elf_find_verdep_info argument. Add a pointer to bool argument, auto_version. Return true if linked against glibc. Otherwise return false. If the version dependency is added, set *auto_version to true. If *auto_version is true, add the version dependency only if libc.so defines the version. (_bfd_elf_link_add_glibc_version_dependency): Add a pointer to bool argument and pass it to elf_link_add_glibc_verneed. (_bfd_elf_link_add_dt_relr_dependency): Pass NULL to _bfd_elf_link_add_glibc_version_dependency. * elfxx-x86.h (elf_x86_link_hash_table): Add has_tls_desc_call. ld/ PR ld/33130 * NEWS: Mention --gnu2-tls-tag, --no-gnu2-tls-tag and --enable-gnu2-tls-tag. * config.in: Regenerated. * configure: Likewise. * configure.ac: Add --enable-gnu2-tls-tag. * ld.texi: Document --gnu2-tls-tag/--no-gnu2-tls-tag. * ldlex.h (option_values): Add OPTION_GNU2_TLS_VERSION_TAG and OPTION_NO_GNU2_TLS_VERSION_TAG. * emulparams/elf32_x86_64.sh (EXTRA_EM_FILE): Changed to "elf-x86-64-glibc". * emulparams/elf_i386.sh (EXTRA_EM_FILE): Set to "elf-i386-glibc". * emulparams/elf_i386_fbsd.sh (EXTRA_EM_FILE): New. Set to "elf-x86". * emulparams/elf_i386_haiku.sh (EXTRA_EM_FILE): Likewise. * emulparams/elf_x86_64.sh (EXTRA_EM_FILE): Likewise. * emulparams/elf_x86_64_fbsd.sh (EXTRA_EM_FILE): New. Set to "elf-x86-64". * emulparams/elf_x86_64_haiku.sh (EXTRA_EM_FILE): Likewise. * (EXTRA_EM_FILE): Likewise. * (EXTRA_EM_FILE): Likewise. * emultempl/elf-i386-glibc.em: New file. * emultempl/elf-x86-64-glibc.em: Likewise. * emultempl/elf-x86-64.em: Likewise. * emultempl/elf-x86-glibc.em: Likewise. * emultempl/elf-x86.em (elf_x86_64_before_parse): Removed. (LDEMUL_BEFORE_PARSE): Likewise. (elf_x86_64_before_allocation): Likewise. (LDEMUL_BEFORE_ALLOCATION): Likewise. * emultempl/solaris2-x86-64.em: New file. * testsuite/ld-i386/gnu2-tls-1.s: Likewise. * testsuite/ld-i386/gnu2-tls-1a.rd: Likewise. * testsuite/ld-i386/gnu2-tls-1b.rd: Likewise. * testsuite/ld-x86-64/gnu2-tls-1.s: Likewise. * testsuite/ld-x86-64/gnu2-tls-1a.rd: Likewise. * testsuite/ld-x86-64/gnu2-tls-1b.rd: Likewise. * testsuite/ld-x86-64/mark-plt-2.rd: Likewise. * testsuite/ld-x86-64/mark-plt-2.s: Likewise. * testsuite/ld-i386/i386.exp: Run GLIBC_ABI_GNU2_TLS tests. * testsuite/ld-x86-64/x86-64.exp: Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
303 lines
8.3 KiB
Plaintext
303 lines
8.3 KiB
Plaintext
/* config.in. Generated from configure.ac by autoheader. */
|
|
|
|
/* Check that config.h is #included before system headers
|
|
(this works only for glibc, but that should be enough). */
|
|
#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
|
|
# error config.h must be #included before system headers
|
|
#endif
|
|
#define __CONFIG_H__ 1
|
|
|
|
/* Default compression algorithm for --enable-compressed-debug-sections. */
|
|
#undef DEFAULT_COMPRESSED_DEBUG_ALGORITHM
|
|
|
|
/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */
|
|
#undef DEFAULT_EMIT_GNU_HASH
|
|
|
|
/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */
|
|
#undef DEFAULT_EMIT_SYSV_HASH
|
|
|
|
/* Define if you want compressed debug sections by default. */
|
|
#undef DEFAULT_FLAG_COMPRESS_DEBUG
|
|
|
|
/* Define to 1 if you want to turn executable stack warnings into errors by
|
|
default. */
|
|
#undef DEFAULT_LD_ERROR_EXECSTACK
|
|
|
|
/* Define to 1 if you want to turn executable segment warnings into errors by
|
|
default. */
|
|
#undef DEFAULT_LD_ERROR_RWX_SEGMENTS
|
|
|
|
/* Define to 0 if you want to disable the generation of an executable stack
|
|
when a .note-GNU-stack section is missing. */
|
|
#undef DEFAULT_LD_EXECSTACK
|
|
|
|
/* Define to 1 if you want to enable --gnu2-tls-tag in ELF i386/x86-64 linker
|
|
by default. */
|
|
#undef DEFAULT_LD_GNU2_TLS_TAG
|
|
|
|
/* Define to 1 if you want to enable --rosegment in the ELF linker by default.
|
|
*/
|
|
#undef DEFAULT_LD_ROSEGMENT
|
|
|
|
/* The default method for DT_TEXTREL check in ELF linker. */
|
|
#undef DEFAULT_LD_TEXTREL_CHECK
|
|
|
|
/* Define to 1 if DT_TEXTREL check is warning in ELF linker by default. */
|
|
#undef DEFAULT_LD_TEXTREL_CHECK_WARNING
|
|
|
|
/* Define to 1 if you want to enable --warn-execstack in ELF linker by
|
|
default. */
|
|
#undef DEFAULT_LD_WARN_EXECSTACK
|
|
|
|
/* Define to 0 if you want to disable --warn-rwx-segments in ELF linker by
|
|
default. */
|
|
#undef DEFAULT_LD_WARN_RWX_SEGMENTS
|
|
|
|
/* Define to 1 if you want to enable -z mark-plt in ELF x86-64 linker by
|
|
default. */
|
|
#undef DEFAULT_LD_Z_MARK_PLT
|
|
|
|
/* Define to 1 if you want to enable -z memory_seal in ELF linker by default.
|
|
*/
|
|
#undef DEFAULT_LD_Z_MEMORY_SEAL
|
|
|
|
/* Define to 1 if you want to enable -z relro in ELF linker by default. */
|
|
#undef DEFAULT_LD_Z_RELRO
|
|
|
|
/* Define to 1 if you want to enable -z separate-code in ELF linker by
|
|
default. */
|
|
#undef DEFAULT_LD_Z_SEPARATE_CODE
|
|
|
|
/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default.
|
|
*/
|
|
#undef DEFAULT_NEW_DTAGS
|
|
|
|
/* Define if you want run-time sanity checks. */
|
|
#undef ENABLE_CHECKING
|
|
|
|
/* Handle .ctf type-info sections */
|
|
#undef ENABLE_LIBCTF
|
|
|
|
/* Define to 1 if translation of program messages to the user's native
|
|
language is requested. */
|
|
#undef ENABLE_NLS
|
|
|
|
/* Additional extension a shared object might have. */
|
|
#undef EXTRA_SHLIB_EXTENSION
|
|
|
|
/* Define to choose default GOT handling scheme */
|
|
#undef GOT_HANDLING_DEFAULT
|
|
|
|
/* Define to 1 if you have the Mac OS X function
|
|
CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
|
|
#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
|
|
|
|
/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
|
|
the CoreFoundation framework. */
|
|
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
|
|
|
|
/* Define to 1 if you have the `close' function. */
|
|
#undef HAVE_CLOSE
|
|
|
|
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
|
*/
|
|
#undef HAVE_DCGETTEXT
|
|
|
|
/* Define to 1 if you have the declaration of `environ', and to 0 if you
|
|
don't. */
|
|
#undef HAVE_DECL_ENVIRON
|
|
|
|
/* Is the prototype for getopt in <unistd.h> in the expected format? */
|
|
#undef HAVE_DECL_GETOPT
|
|
|
|
/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
|
|
*/
|
|
#undef HAVE_DECL_STPCPY
|
|
|
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
#undef HAVE_DLFCN_H
|
|
|
|
/* Define to 1 if you have the <elf-hints.h> header file. */
|
|
#undef HAVE_ELF_HINTS_H
|
|
|
|
/* Define to 1 if you have the <fcntl.h> header file. */
|
|
#undef HAVE_FCNTL_H
|
|
|
|
/* Define to 1 if you have the `getpagesize' function. */
|
|
#undef HAVE_GETPAGESIZE
|
|
|
|
/* Define to 1 if you have the `getrusage' function. */
|
|
#undef HAVE_GETRUSAGE
|
|
|
|
/* Define if the GNU gettext() function is already present or preinstalled. */
|
|
#undef HAVE_GETTEXT
|
|
|
|
/* Define to 1 if you have the `glob' function. */
|
|
#undef HAVE_GLOB
|
|
|
|
/* Define if you have the iconv() function and it works. */
|
|
#undef HAVE_ICONV
|
|
|
|
/* Define .init_array/.fini_array sections are available and working. */
|
|
#undef HAVE_INITFINI_ARRAY
|
|
|
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
#undef HAVE_INTTYPES_H
|
|
|
|
/* The jansson library is to be used */
|
|
#undef HAVE_JANSSON
|
|
|
|
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
|
#undef HAVE_LC_MESSAGES
|
|
|
|
/* Define to 1 if you have the <limits.h> header file. */
|
|
#undef HAVE_LIMITS_H
|
|
|
|
/* Define to 1 if you have the `lseek' function. */
|
|
#undef HAVE_LSEEK
|
|
|
|
/* Define to 1 if you have the <memory.h> header file. */
|
|
#undef HAVE_MEMORY_H
|
|
|
|
/* Define to 1 if you have the `mkstemp' function. */
|
|
#undef HAVE_MKSTEMP
|
|
|
|
/* Define to 1 if you have a working `mmap' system call. */
|
|
#undef HAVE_MMAP
|
|
|
|
/* Define to 1 if you have the `open' function. */
|
|
#undef HAVE_OPEN
|
|
|
|
/* Define to 1 if you have the `realpath' function. */
|
|
#undef HAVE_REALPATH
|
|
|
|
/* Define to 1 if you have the <stdint.h> header file. */
|
|
#undef HAVE_STDINT_H
|
|
|
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
#undef HAVE_STDLIB_H
|
|
|
|
/* Define to 1 if you have the <strings.h> header file. */
|
|
#undef HAVE_STRINGS_H
|
|
|
|
/* Define to 1 if you have the <string.h> header file. */
|
|
#undef HAVE_STRING_H
|
|
|
|
/* Define to 1 if you have the <sys/file.h> header file. */
|
|
#undef HAVE_SYS_FILE_H
|
|
|
|
/* Define to 1 if you have the <sys/mman.h> header file. */
|
|
#undef HAVE_SYS_MMAN_H
|
|
|
|
/* Define to 1 if you have the <sys/param.h> header file. */
|
|
#undef HAVE_SYS_PARAM_H
|
|
|
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
#undef HAVE_SYS_STAT_H
|
|
|
|
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
#undef HAVE_SYS_TIME_H
|
|
|
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
#undef HAVE_SYS_TYPES_H
|
|
|
|
/* Define to 1 if you have the <unistd.h> header file. */
|
|
#undef HAVE_UNISTD_H
|
|
|
|
/* Define to 1 if you have the `waitpid' function. */
|
|
#undef HAVE_WAITPID
|
|
|
|
/* Define to 1 if you have the <windows.h> header file. */
|
|
#undef HAVE_WINDOWS_H
|
|
|
|
/* Define to 1 if zstd is enabled. */
|
|
#undef HAVE_ZSTD
|
|
|
|
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
|
*/
|
|
#undef LT_OBJDIR
|
|
|
|
/* Name of package */
|
|
#undef PACKAGE
|
|
|
|
/* Define to the address where bug reports for this package should be sent. */
|
|
#undef PACKAGE_BUGREPORT
|
|
|
|
/* Define to the full name of this package. */
|
|
#undef PACKAGE_NAME
|
|
|
|
/* Define to the full name and version of this package. */
|
|
#undef PACKAGE_STRING
|
|
|
|
/* Define to the one symbol short name of this package. */
|
|
#undef PACKAGE_TARNAME
|
|
|
|
/* Define to the home page for this package. */
|
|
#undef PACKAGE_URL
|
|
|
|
/* Define to the version of this package. */
|
|
#undef PACKAGE_VERSION
|
|
|
|
/* Define to 1 if you have the ANSI C header files. */
|
|
#undef STDC_HEADERS
|
|
|
|
/* Define to 1 if you want to support the --error-handling-script command line
|
|
option. */
|
|
#undef SUPPORT_ERROR_HANDLING_SCRIPT
|
|
|
|
/* Use b modifier when opening binary files? */
|
|
#undef USE_BINARY_FOPEN
|
|
|
|
/* Enable extensions on AIX 3, Interix. */
|
|
#ifndef _ALL_SOURCE
|
|
# undef _ALL_SOURCE
|
|
#endif
|
|
/* Enable GNU extensions on systems that have them. */
|
|
#ifndef _GNU_SOURCE
|
|
# undef _GNU_SOURCE
|
|
#endif
|
|
/* Enable threading extensions on Solaris. */
|
|
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
# undef _POSIX_PTHREAD_SEMANTICS
|
|
#endif
|
|
/* Enable extensions on HP NonStop. */
|
|
#ifndef _TANDEM_SOURCE
|
|
# undef _TANDEM_SOURCE
|
|
#endif
|
|
/* Enable general extensions on Solaris. */
|
|
#ifndef __EXTENSIONS__
|
|
# undef __EXTENSIONS__
|
|
#endif
|
|
|
|
|
|
/* Version number of package */
|
|
#undef VERSION
|
|
|
|
/* whether to use inline xxhash */
|
|
#undef WITH_XXHASH
|
|
|
|
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
|
`char[]'. */
|
|
#undef YYTEXT_POINTER
|
|
|
|
/* Enable large inode numbers on Mac OS X 10.5. */
|
|
#ifndef _DARWIN_USE_64_BIT_INODE
|
|
# define _DARWIN_USE_64_BIT_INODE 1
|
|
#endif
|
|
|
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
|
#undef _FILE_OFFSET_BITS
|
|
|
|
/* Define for large files, on AIX-style hosts. */
|
|
#undef _LARGE_FILES
|
|
|
|
/* Define to 1 if on MINIX. */
|
|
#undef _MINIX
|
|
|
|
/* Define to 2 if the system does not provide POSIX.1 features except with
|
|
this defined. */
|
|
#undef _POSIX_1_SOURCE
|
|
|
|
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
|
#undef _POSIX_SOURCE
|