2001-09-19 10:37:31 +00:00
|
|
|
# The i387 `long double' is a distinct type we support.
|
|
|
|
long-double-fcts = yes
|
|
|
|
|
|
|
|
ifeq ($(subdir),csu)
|
2009-07-10 19:04:14 +00:00
|
|
|
gen-as-const-headers += link-defines.sym
|
2001-09-19 10:37:31 +00:00
|
|
|
endif
|
2002-08-21 07:57:48 +00:00
|
|
|
|
|
|
|
ifeq ($(subdir),gmon)
|
|
|
|
sysdep_routines += _mcount
|
2016-03-04 16:44:43 +00:00
|
|
|
# We cannot compile _mcount.S with -pg because that would create
|
|
|
|
# recursive calls when ENTRY is used. Just copy the normal static
|
|
|
|
# object.
|
2016-03-03 14:55:59 +00:00
|
|
|
sysdep_noprof += _mcount
|
2002-08-21 07:57:48 +00:00
|
|
|
endif
|
2007-05-21 19:21:48 +00:00
|
|
|
|
|
|
|
ifeq ($(subdir),string)
|
2022-07-04 04:28:07 +00:00
|
|
|
sysdep_routines += \
|
|
|
|
strcasecmp_l-nonascii \
|
|
|
|
strcspn-generic \
|
|
|
|
strncase_l-nonascii \
|
|
|
|
strpbrk-generic \
|
|
|
|
strspn-generic \
|
|
|
|
varshift \
|
|
|
|
# sysdep_routines
|
2010-07-30 07:14:04 +00:00
|
|
|
gen-as-const-headers += locale-defines.sym
|
2021-07-08 20:13:17 +00:00
|
|
|
tests += \
|
|
|
|
tst-rsi-strlen
|
2007-05-21 19:21:48 +00:00
|
|
|
endif
|
Introduce TLS descriptors for i386 and x86_64.
* include/inline-hashtab.h: New file, copied from 2005's
libiberty, with fix for memory leak imported afterwards by
Glauber de Oliveira Costa.
* elf/tlsdeschtab.h: New file.
* elf/dl-reloc.c (_dl_try_allocate_static_tls): Extract from...
(_dl_allocate_static_tls): ... here. Rearrange failure path.
(CHECK_STATIC_TLS): Move to...
* elf/dynamic-link.h: ... this file.
(TRY_STATIC_TLS): New macro.
* elf/dl-conflict.c (CHECK_STATIC_TLS, TRY_STATIC_TLS): Override.
* elf/elf.h (R_386_TLS_GOTDESC, R_386_TLS_DESC_CALL,
R_386_TLS_DESC): Define.
(R_X86_64_PC64, R_X86_GOTOFF64, R_X86_64_GOTPC32): Merge from
binutils.
(R_X86_64_GOTPC32_TLSDESC, R_X86_64_TLSDESC_CALL,
R_X86_64_TLSDESC): Define.
(R_386_NUM, R_X86_64_NUM): Adjust.
* sysdeps/i386/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/i386/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/i386/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_type_class): Mark R_386_TLS_DESC as PLT class.
(elf_machine_rel): Handle R_386_TLS_DESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
(elf_machine_lazy_rela): Likewise.
* sysdeps/i386/dl-tls.h (struct dl_tls_index): Name it.
* sysdeps/i386/dl-tlsdesc.S: New file.
* sysdeps/i386/dl-tlsdesc.h: New file.
* sysdeps/i386/tlsdesc.c: New file.
* sysdeps/i386/tlsdesc.sym: New file.
* sysdeps/i386/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table.
* sysdeps/x86_64/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/x86_64/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/x86_64/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_runtime_setup): Set up lazy TLSDESC GOT entry.
(elf_machine_type_class): Mark R_X86_64_TLSDESC as PLT class.
(elf_machine_rel): Handle R_X86_64_TLSDESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/x86_64/dl-tls.h (struct dl_tls_index): Name it.
(__tls_get_addr): Do not declare for non-shared compiles.
* sysdeps/x86_64/dl-tlsdesc.S: New file.
* sysdeps/x86_64/dl-tlsdesc.h: New file.
* sysdeps/x86_64/tlsdesc.c: New file.
* sysdeps/x86_64/tlsdesc.sym: New file.
* sysdeps/x86_64/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table for both 32- and 64-bit structs.
2008-05-13 05:41:30 +00:00
|
|
|
|
|
|
|
ifeq ($(subdir),elf)
|
2015-08-26 14:55:42 +00:00
|
|
|
# There is no good reason to use MMX in x86-64 ld.so with GCC.
|
|
|
|
CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
|
|
|
|
-mno-mmx)
|
|
|
|
|
2017-07-06 11:43:06 +00:00
|
|
|
sysdep-dl-routines += tlsdesc dl-tlsdesc tls_get_addr
|
2009-07-26 23:10:00 +00:00
|
|
|
|
Save and restore vector registers in x86-64 ld.so
This patch adds SSE, AVX and AVX512 versions of _dl_runtime_resolve
and _dl_runtime_profile, which save and restore the first 8 vector
registers used for parameter passing. elf_machine_runtime_setup
selects the proper _dl_runtime_resolve or _dl_runtime_profile based
on _dl_x86_cpu_features. It avoids race condition caused by
FOREIGN_CALL macros, which are only used for x86-64.
Performance impact of saving and restoring 8 vector registers are
negligible on Nehalem, Sandy Bridge, Ivy Bridge and Haswell when
ld.so is optimized with SSE2.
[BZ #15128]
* sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
ifuncmain8.
(modules-names): Add ifuncmod8.
($(objpfx)ifuncmain8): New rule.
* sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
<cpuid.h>.
(elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
_dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
_dl_runtime_profile_sse, _dl_runtime_profile_avx, or
_dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
* sysdeps/x86_64/dl-trampoline.S: Rewrite.
* sysdeps/x86_64/dl-trampoline.h: Likewise.
* sysdeps/x86_64/ifuncmain8.c: New file.
* sysdeps/x86_64/ifuncmod8.c: Likewise.
* sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
Removed.
* sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
(tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
Change rtld_savespace_sse to __glibc_unused2.
(RTLD_CHECK_FOREIGN_CALL): Removed.
(RTLD_ENABLE_FOREIGN_CALL): Likewise.
(RTLD_PREPARE_FOREIGN_CALL): Likewise.
(RTLD_FINALIZE_FOREIGN_CALL): Likewise.
2015-08-25 11:33:54 +00:00
|
|
|
tests += ifuncmain8
|
|
|
|
modules-names += ifuncmod8
|
|
|
|
|
|
|
|
$(objpfx)ifuncmain8: $(objpfx)ifuncmod8.so
|
|
|
|
|
2012-05-11 00:05:06 +00:00
|
|
|
tests += tst-quad1 tst-quad2
|
|
|
|
modules-names += tst-quadmod1 tst-quadmod2
|
|
|
|
|
|
|
|
$(objpfx)tst-quad1: $(objpfx)tst-quadmod1.so
|
|
|
|
$(objpfx)tst-quad2: $(objpfx)tst-quadmod2.so
|
|
|
|
|
|
|
|
quad-pie-test += tst-quad1pie tst-quad2pie
|
|
|
|
tests += $(quad-pie-test)
|
|
|
|
tests-pie += $(quad-pie-test)
|
2016-04-13 15:04:37 +00:00
|
|
|
test-extras += tst-quadmod1pie tst-quadmod2pie
|
|
|
|
extra-test-objs += tst-quadmod1pie.o tst-quadmod2pie.o
|
2012-05-11 00:05:06 +00:00
|
|
|
|
|
|
|
$(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
|
|
|
|
$(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
|
2013-04-25 19:23:11 +00:00
|
|
|
|
2016-12-21 11:04:12 +00:00
|
|
|
CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
|
|
|
|
CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
|
|
|
|
|
2017-09-11 15:18:11 +00:00
|
|
|
tests += tst-x86_64-1
|
|
|
|
modules-names += x86_64/tst-x86_64mod-1
|
2022-02-24 22:10:45 +00:00
|
|
|
extra-test-objs += tst-x86_64mod-1.o
|
2017-09-11 15:18:11 +00:00
|
|
|
LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
|
x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265]
In _dl_runtime_resolve, use fxsave/xsave/xsavec to preserve all vector,
mask and bound registers. It simplifies _dl_runtime_resolve and supports
different calling conventions. ld.so code size is reduced by more than
1 KB. However, use fxsave/xsave/xsavec takes a little bit more cycles
than saving and restoring vector and bound registers individually.
Latency for _dl_runtime_resolve to lookup the function, foo, from one
shared library plus libc.so:
Before After Change
Westmere (SSE)/fxsave 345 866 151%
IvyBridge (AVX)/xsave 420 643 53%
Haswell (AVX)/xsave 713 1252 75%
Skylake (AVX+MPX)/xsavec 559 719 28%
Skylake (AVX512+MPX)/xsavec 145 272 87%
Ryzen (AVX)/xsavec 280 553 97%
This is the worst case where portion of time spent for saving and
restoring registers is bigger than majority of cases. With smaller
_dl_runtime_resolve code size, overall performance impact is negligible.
On IvyBridge, differences in build and test time of binutils with lazy
binding GCC and binutils are noises. On Westmere, differences in
bootstrap and "makc check" time of GCC 7 with lazy binding GCC and
binutils are also noises.
[BZ #21265]
* sysdeps/x86/cpu-features-offsets.sym (XSAVE_STATE_SIZE_OFFSET):
New.
* sysdeps/x86/cpu-features.c: Include <libc-pointer-arith.h>.
(get_common_indeces): Set xsave_state_size, xsave_state_full_size
and bit_arch_XSAVEC_Usable if needed.
(init_cpu_features): Remove bit_arch_Use_dl_runtime_resolve_slow
and bit_arch_Use_dl_runtime_resolve_opt.
* sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
Removed.
(bit_arch_Use_dl_runtime_resolve_slow): Likewise.
(bit_arch_Prefer_No_AVX512): Updated.
(bit_arch_MathVec_Prefer_No_AVX512): Likewise.
(bit_arch_XSAVEC_Usable): New.
(STATE_SAVE_OFFSET): Likewise.
(STATE_SAVE_MASK): Likewise.
[__ASSEMBLER__]: Include <cpu-features-offsets.h>.
(cpu_features): Add xsave_state_size and xsave_state_full_size.
(index_arch_Use_dl_runtime_resolve_opt): Removed.
(index_arch_Use_dl_runtime_resolve_slow): Likewise.
(index_arch_XSAVEC_Usable): New.
* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
Support XSAVEC_Usable. Remove Use_dl_runtime_resolve_slow.
* sysdeps/x86_64/Makefile (tst-x86_64-1-ENV): New if tunables
is enabled.
* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
Replace _dl_runtime_resolve_sse, _dl_runtime_resolve_avx,
_dl_runtime_resolve_avx_slow, _dl_runtime_resolve_avx_opt,
_dl_runtime_resolve_avx512 and _dl_runtime_resolve_avx512_opt
with _dl_runtime_resolve_fxsave, _dl_runtime_resolve_xsave and
_dl_runtime_resolve_xsavec.
* sysdeps/x86_64/dl-trampoline.S (DL_RUNTIME_UNALIGNED_VEC_SIZE):
Removed.
(DL_RUNTIME_RESOLVE_REALIGN_STACK): Check STATE_SAVE_ALIGNMENT
instead of VEC_SIZE.
(REGISTER_SAVE_BND0): Removed.
(REGISTER_SAVE_BND1): Likewise.
(REGISTER_SAVE_BND3): Likewise.
(REGISTER_SAVE_RAX): Always defined to 0.
(VMOV): Removed.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_slow): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_avx512): Likewise.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(USE_FXSAVE): New.
(_dl_runtime_resolve_fxsave): Likewise.
(USE_XSAVE): Likewise.
(_dl_runtime_resolve_xsave): Likewise.
(USE_XSAVEC): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.
* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx512):
Removed.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(_dl_runtime_resolve_fxsave): New.
(_dl_runtime_resolve_xsave): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.
2017-10-20 18:00:08 +00:00
|
|
|
ifneq (no,$(have-tunables))
|
|
|
|
# Test the state size for XSAVE when XSAVEC is disabled.
|
2020-06-29 23:36:08 +00:00
|
|
|
tst-x86_64-1-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-XSAVEC
|
x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265]
In _dl_runtime_resolve, use fxsave/xsave/xsavec to preserve all vector,
mask and bound registers. It simplifies _dl_runtime_resolve and supports
different calling conventions. ld.so code size is reduced by more than
1 KB. However, use fxsave/xsave/xsavec takes a little bit more cycles
than saving and restoring vector and bound registers individually.
Latency for _dl_runtime_resolve to lookup the function, foo, from one
shared library plus libc.so:
Before After Change
Westmere (SSE)/fxsave 345 866 151%
IvyBridge (AVX)/xsave 420 643 53%
Haswell (AVX)/xsave 713 1252 75%
Skylake (AVX+MPX)/xsavec 559 719 28%
Skylake (AVX512+MPX)/xsavec 145 272 87%
Ryzen (AVX)/xsavec 280 553 97%
This is the worst case where portion of time spent for saving and
restoring registers is bigger than majority of cases. With smaller
_dl_runtime_resolve code size, overall performance impact is negligible.
On IvyBridge, differences in build and test time of binutils with lazy
binding GCC and binutils are noises. On Westmere, differences in
bootstrap and "makc check" time of GCC 7 with lazy binding GCC and
binutils are also noises.
[BZ #21265]
* sysdeps/x86/cpu-features-offsets.sym (XSAVE_STATE_SIZE_OFFSET):
New.
* sysdeps/x86/cpu-features.c: Include <libc-pointer-arith.h>.
(get_common_indeces): Set xsave_state_size, xsave_state_full_size
and bit_arch_XSAVEC_Usable if needed.
(init_cpu_features): Remove bit_arch_Use_dl_runtime_resolve_slow
and bit_arch_Use_dl_runtime_resolve_opt.
* sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
Removed.
(bit_arch_Use_dl_runtime_resolve_slow): Likewise.
(bit_arch_Prefer_No_AVX512): Updated.
(bit_arch_MathVec_Prefer_No_AVX512): Likewise.
(bit_arch_XSAVEC_Usable): New.
(STATE_SAVE_OFFSET): Likewise.
(STATE_SAVE_MASK): Likewise.
[__ASSEMBLER__]: Include <cpu-features-offsets.h>.
(cpu_features): Add xsave_state_size and xsave_state_full_size.
(index_arch_Use_dl_runtime_resolve_opt): Removed.
(index_arch_Use_dl_runtime_resolve_slow): Likewise.
(index_arch_XSAVEC_Usable): New.
* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
Support XSAVEC_Usable. Remove Use_dl_runtime_resolve_slow.
* sysdeps/x86_64/Makefile (tst-x86_64-1-ENV): New if tunables
is enabled.
* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
Replace _dl_runtime_resolve_sse, _dl_runtime_resolve_avx,
_dl_runtime_resolve_avx_slow, _dl_runtime_resolve_avx_opt,
_dl_runtime_resolve_avx512 and _dl_runtime_resolve_avx512_opt
with _dl_runtime_resolve_fxsave, _dl_runtime_resolve_xsave and
_dl_runtime_resolve_xsavec.
* sysdeps/x86_64/dl-trampoline.S (DL_RUNTIME_UNALIGNED_VEC_SIZE):
Removed.
(DL_RUNTIME_RESOLVE_REALIGN_STACK): Check STATE_SAVE_ALIGNMENT
instead of VEC_SIZE.
(REGISTER_SAVE_BND0): Removed.
(REGISTER_SAVE_BND1): Likewise.
(REGISTER_SAVE_BND3): Likewise.
(REGISTER_SAVE_RAX): Always defined to 0.
(VMOV): Removed.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_slow): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_avx512): Likewise.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(USE_FXSAVE): New.
(_dl_runtime_resolve_fxsave): Likewise.
(USE_XSAVE): Likewise.
(_dl_runtime_resolve_xsave): Likewise.
(USE_XSAVEC): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.
* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx512):
Removed.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(_dl_runtime_resolve_fxsave): New.
(_dl_runtime_resolve_xsave): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.
2017-10-20 18:00:08 +00:00
|
|
|
endif
|
2017-09-11 15:18:11 +00:00
|
|
|
|
|
|
|
$(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
|
|
|
|
|
2017-10-19 15:28:09 +00:00
|
|
|
ifneq (no,$(have-tunables))
|
|
|
|
tests += tst-platform-1
|
|
|
|
modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
|
2022-02-24 22:10:45 +00:00
|
|
|
extra-test-objs += tst-platformmod-2.o
|
2017-10-19 15:28:09 +00:00
|
|
|
CFLAGS-tst-platform-1.c = -mno-avx
|
|
|
|
CFLAGS-tst-platformmod-1.c = -mno-avx
|
|
|
|
CFLAGS-tst-platformmod-2.c = -mno-avx
|
|
|
|
LDFLAGS-tst-platformmod-2.so = -Wl,-soname,tst-platformmod-2.so
|
|
|
|
$(objpfx)tst-platform-1: $(objpfx)tst-platformmod-1.so
|
|
|
|
$(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
|
2020-06-29 23:36:08 +00:00
|
|
|
# Turn off AVX512F and AVX2 so that GLRO(dl_platform) is
|
2017-10-19 15:28:09 +00:00
|
|
|
# always set to x86_64.
|
|
|
|
tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
|
2020-06-29 23:36:08 +00:00
|
|
|
GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX512F,-AVX2
|
2017-10-19 15:28:09 +00:00
|
|
|
endif
|
|
|
|
|
2017-02-09 20:19:44 +00:00
|
|
|
tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
|
|
|
|
tst-audit10 tst-sse tst-avx tst-avx512
|
|
|
|
test-extras += tst-audit4-aux tst-audit10-aux \
|
|
|
|
tst-avx-aux tst-avx512-aux
|
|
|
|
extra-test-objs += tst-audit4-aux.o tst-audit10-aux.o \
|
|
|
|
tst-avx-aux.o tst-avx512-aux.o
|
2014-08-19 22:50:54 +00:00
|
|
|
|
2017-08-04 19:17:15 +00:00
|
|
|
ifeq ($(have-insert),yes)
|
2014-08-19 22:50:54 +00:00
|
|
|
tests += tst-split-dynreloc
|
|
|
|
LDFLAGS-tst-split-dynreloc = -Wl,-T,$(..)sysdeps/x86_64/tst-split-dynreloc.lds
|
|
|
|
tst-split-dynreloc-ENV = LD_BIND_NOW=1
|
2017-08-04 19:17:15 +00:00
|
|
|
endif
|
2014-08-19 22:50:54 +00:00
|
|
|
|
2013-04-25 19:23:11 +00:00
|
|
|
modules-names += tst-auditmod3a tst-auditmod3b \
|
|
|
|
tst-auditmod4a tst-auditmod4b \
|
|
|
|
tst-auditmod5a tst-auditmod5b \
|
|
|
|
tst-auditmod6a tst-auditmod6b tst-auditmod6c \
|
2014-03-13 18:10:22 +00:00
|
|
|
tst-auditmod7a tst-auditmod7b \
|
2017-02-09 20:19:44 +00:00
|
|
|
tst-auditmod10a tst-auditmod10b \
|
|
|
|
tst-ssemod tst-avxmod tst-avx512mod
|
2013-04-25 19:23:11 +00:00
|
|
|
|
|
|
|
$(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
|
|
|
|
$(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
|
|
|
|
tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
|
|
|
|
|
2016-03-07 15:00:25 +00:00
|
|
|
$(objpfx)tst-audit4: $(objpfx)tst-audit4-aux.o $(objpfx)tst-auditmod4a.so
|
2013-04-25 19:23:11 +00:00
|
|
|
$(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so
|
|
|
|
tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so
|
|
|
|
|
|
|
|
$(objpfx)tst-audit5: $(objpfx)tst-auditmod5a.so
|
|
|
|
$(objpfx)tst-audit5.out: $(objpfx)tst-auditmod5b.so
|
|
|
|
tst-audit5-ENV = LD_AUDIT=$(objpfx)tst-auditmod5b.so
|
|
|
|
|
|
|
|
$(objpfx)tst-audit6: $(objpfx)tst-auditmod6a.so
|
|
|
|
$(objpfx)tst-audit6.out: $(objpfx)tst-auditmod6b.so \
|
|
|
|
$(objpfx)tst-auditmod6c.so
|
|
|
|
tst-audit6-ENV = LD_AUDIT=$(objpfx)tst-auditmod6b.so:$(objpfx)tst-auditmod6c.so
|
|
|
|
|
|
|
|
$(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
|
|
|
|
$(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
|
|
|
|
tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
|
|
|
|
|
2016-03-07 15:00:25 +00:00
|
|
|
$(objpfx)tst-audit10: $(objpfx)tst-audit10-aux.o $(objpfx)tst-auditmod10a.so
|
2014-03-13 18:10:22 +00:00
|
|
|
$(objpfx)tst-audit10.out: $(objpfx)tst-auditmod10b.so
|
|
|
|
tst-audit10-ENV = LD_AUDIT=$(objpfx)tst-auditmod10b.so
|
|
|
|
|
2017-02-09 20:19:44 +00:00
|
|
|
$(objpfx)tst-sse: $(objpfx)tst-ssemod.so
|
|
|
|
$(objpfx)tst-avx: $(objpfx)tst-avx-aux.o $(objpfx)tst-avxmod.so
|
|
|
|
$(objpfx)tst-avx512: $(objpfx)tst-avx512-aux.o $(objpfx)tst-avx512mod.so
|
|
|
|
|
2015-10-09 16:03:48 +00:00
|
|
|
AVX-CFLAGS=-mavx -mno-vzeroupper
|
2016-03-07 15:00:25 +00:00
|
|
|
CFLAGS-tst-audit4-aux.c += $(AVX-CFLAGS)
|
2013-04-25 19:23:11 +00:00
|
|
|
CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
|
|
|
|
CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
|
|
|
|
CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
|
|
|
|
CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
|
|
|
|
CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
|
2017-02-09 20:19:44 +00:00
|
|
|
CFLAGS-tst-avx-aux.c += $(AVX-CFLAGS)
|
|
|
|
CFLAGS-tst-avxmod.c += $(AVX-CFLAGS)
|
2014-03-13 18:10:22 +00:00
|
|
|
AVX512-CFLAGS = -mavx512f
|
2016-03-07 15:00:25 +00:00
|
|
|
CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS)
|
2014-03-13 18:10:22 +00:00
|
|
|
CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS)
|
|
|
|
CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS)
|
2017-02-09 20:19:44 +00:00
|
|
|
CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS)
|
|
|
|
CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS)
|
2020-12-04 08:13:43 +00:00
|
|
|
|
|
|
|
$(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \
|
|
|
|
$(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so
|
|
|
|
$(objpfx)tst-glibc-hwcaps.out: \
|
|
|
|
$(objpfx)libmarkermod2.so \
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so \
|
|
|
|
$(objpfx)libmarkermod3.so \
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so \
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so \
|
|
|
|
$(objpfx)libmarkermod4.so \
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so \
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so \
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so \
|
|
|
|
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so: $(objpfx)libmarkermod2-2.so
|
|
|
|
$(make-target-directory)
|
|
|
|
cp $< $@
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so: $(objpfx)libmarkermod3-2.so
|
|
|
|
$(make-target-directory)
|
|
|
|
cp $< $@
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so: $(objpfx)libmarkermod3-3.so
|
|
|
|
$(make-target-directory)
|
|
|
|
cp $< $@
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so: $(objpfx)libmarkermod4-2.so
|
|
|
|
$(make-target-directory)
|
|
|
|
cp $< $@
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so: $(objpfx)libmarkermod4-3.so
|
|
|
|
$(make-target-directory)
|
|
|
|
cp $< $@
|
|
|
|
$(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so: $(objpfx)libmarkermod4-4.so
|
|
|
|
$(make-target-directory)
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
ifeq (no,$(build-hardcoded-path-in-tests))
|
|
|
|
# This is an ld.so.cache test, and RPATH/RUNPATH in the executable
|
|
|
|
# interferes with its test objectives.
|
|
|
|
tests-container += tst-glibc-hwcaps-cache
|
Introduce TLS descriptors for i386 and x86_64.
* include/inline-hashtab.h: New file, copied from 2005's
libiberty, with fix for memory leak imported afterwards by
Glauber de Oliveira Costa.
* elf/tlsdeschtab.h: New file.
* elf/dl-reloc.c (_dl_try_allocate_static_tls): Extract from...
(_dl_allocate_static_tls): ... here. Rearrange failure path.
(CHECK_STATIC_TLS): Move to...
* elf/dynamic-link.h: ... this file.
(TRY_STATIC_TLS): New macro.
* elf/dl-conflict.c (CHECK_STATIC_TLS, TRY_STATIC_TLS): Override.
* elf/elf.h (R_386_TLS_GOTDESC, R_386_TLS_DESC_CALL,
R_386_TLS_DESC): Define.
(R_X86_64_PC64, R_X86_GOTOFF64, R_X86_64_GOTPC32): Merge from
binutils.
(R_X86_64_GOTPC32_TLSDESC, R_X86_64_TLSDESC_CALL,
R_X86_64_TLSDESC): Define.
(R_386_NUM, R_X86_64_NUM): Adjust.
* sysdeps/i386/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/i386/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/i386/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_type_class): Mark R_386_TLS_DESC as PLT class.
(elf_machine_rel): Handle R_386_TLS_DESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
(elf_machine_lazy_rela): Likewise.
* sysdeps/i386/dl-tls.h (struct dl_tls_index): Name it.
* sysdeps/i386/dl-tlsdesc.S: New file.
* sysdeps/i386/dl-tlsdesc.h: New file.
* sysdeps/i386/tlsdesc.c: New file.
* sysdeps/i386/tlsdesc.sym: New file.
* sysdeps/i386/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table.
* sysdeps/x86_64/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/x86_64/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/x86_64/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_runtime_setup): Set up lazy TLSDESC GOT entry.
(elf_machine_type_class): Mark R_X86_64_TLSDESC as PLT class.
(elf_machine_rel): Handle R_X86_64_TLSDESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/x86_64/dl-tls.h (struct dl_tls_index): Name it.
(__tls_get_addr): Do not declare for non-shared compiles.
* sysdeps/x86_64/dl-tlsdesc.S: New file.
* sysdeps/x86_64/dl-tlsdesc.h: New file.
* sysdeps/x86_64/tlsdesc.c: New file.
* sysdeps/x86_64/tlsdesc.sym: New file.
* sysdeps/x86_64/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table for both 32- and 64-bit structs.
2008-05-13 05:41:30 +00:00
|
|
|
endif
|
|
|
|
|
2021-03-16 14:41:46 +00:00
|
|
|
tests-internal += tst-x86-64-tls-1
|
|
|
|
|
2020-12-04 08:13:43 +00:00
|
|
|
endif # $(subdir) == elf
|
|
|
|
|
Introduce TLS descriptors for i386 and x86_64.
* include/inline-hashtab.h: New file, copied from 2005's
libiberty, with fix for memory leak imported afterwards by
Glauber de Oliveira Costa.
* elf/tlsdeschtab.h: New file.
* elf/dl-reloc.c (_dl_try_allocate_static_tls): Extract from...
(_dl_allocate_static_tls): ... here. Rearrange failure path.
(CHECK_STATIC_TLS): Move to...
* elf/dynamic-link.h: ... this file.
(TRY_STATIC_TLS): New macro.
* elf/dl-conflict.c (CHECK_STATIC_TLS, TRY_STATIC_TLS): Override.
* elf/elf.h (R_386_TLS_GOTDESC, R_386_TLS_DESC_CALL,
R_386_TLS_DESC): Define.
(R_X86_64_PC64, R_X86_GOTOFF64, R_X86_64_GOTPC32): Merge from
binutils.
(R_X86_64_GOTPC32_TLSDESC, R_X86_64_TLSDESC_CALL,
R_X86_64_TLSDESC): Define.
(R_386_NUM, R_X86_64_NUM): Adjust.
* sysdeps/i386/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/i386/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/i386/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_type_class): Mark R_386_TLS_DESC as PLT class.
(elf_machine_rel): Handle R_386_TLS_DESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
(elf_machine_lazy_rela): Likewise.
* sysdeps/i386/dl-tls.h (struct dl_tls_index): Name it.
* sysdeps/i386/dl-tlsdesc.S: New file.
* sysdeps/i386/dl-tlsdesc.h: New file.
* sysdeps/i386/tlsdesc.c: New file.
* sysdeps/i386/tlsdesc.sym: New file.
* sysdeps/i386/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table.
* sysdeps/x86_64/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/x86_64/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/x86_64/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_runtime_setup): Set up lazy TLSDESC GOT entry.
(elf_machine_type_class): Mark R_X86_64_TLSDESC as PLT class.
(elf_machine_rel): Handle R_X86_64_TLSDESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/x86_64/dl-tls.h (struct dl_tls_index): Name it.
(__tls_get_addr): Do not declare for non-shared compiles.
* sysdeps/x86_64/dl-tlsdesc.S: New file.
* sysdeps/x86_64/dl-tlsdesc.h: New file.
* sysdeps/x86_64/tlsdesc.c: New file.
* sysdeps/x86_64/tlsdesc.sym: New file.
* sysdeps/x86_64/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table for both 32- and 64-bit structs.
2008-05-13 05:41:30 +00:00
|
|
|
ifeq ($(subdir),csu)
|
2017-07-06 11:43:06 +00:00
|
|
|
gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
|
Introduce TLS descriptors for i386 and x86_64.
* include/inline-hashtab.h: New file, copied from 2005's
libiberty, with fix for memory leak imported afterwards by
Glauber de Oliveira Costa.
* elf/tlsdeschtab.h: New file.
* elf/dl-reloc.c (_dl_try_allocate_static_tls): Extract from...
(_dl_allocate_static_tls): ... here. Rearrange failure path.
(CHECK_STATIC_TLS): Move to...
* elf/dynamic-link.h: ... this file.
(TRY_STATIC_TLS): New macro.
* elf/dl-conflict.c (CHECK_STATIC_TLS, TRY_STATIC_TLS): Override.
* elf/elf.h (R_386_TLS_GOTDESC, R_386_TLS_DESC_CALL,
R_386_TLS_DESC): Define.
(R_X86_64_PC64, R_X86_GOTOFF64, R_X86_64_GOTPC32): Merge from
binutils.
(R_X86_64_GOTPC32_TLSDESC, R_X86_64_TLSDESC_CALL,
R_X86_64_TLSDESC): Define.
(R_386_NUM, R_X86_64_NUM): Adjust.
* sysdeps/i386/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/i386/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/i386/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_type_class): Mark R_386_TLS_DESC as PLT class.
(elf_machine_rel): Handle R_386_TLS_DESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
(elf_machine_lazy_rela): Likewise.
* sysdeps/i386/dl-tls.h (struct dl_tls_index): Name it.
* sysdeps/i386/dl-tlsdesc.S: New file.
* sysdeps/i386/dl-tlsdesc.h: New file.
* sysdeps/i386/tlsdesc.c: New file.
* sysdeps/i386/tlsdesc.sym: New file.
* sysdeps/i386/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table.
* sysdeps/x86_64/Makefile (sysdep-dl-routines, sysdep_routines,
systep-rtld-routines): Add tlsdesc and dl-tlsdesc for elf subdir.
(gen-as-const-headers): Add tlsdesc.sym to csu subdir.
* sysdeps/x86_64/dl-lookupcfg.h: New file. Introduce _dl_unmap to
release tlsdesc_table.
* sysdeps/x86_64/dl-machine.h: Include dl-tlsdesc.h.
(elf_machine_runtime_setup): Set up lazy TLSDESC GOT entry.
(elf_machine_type_class): Mark R_X86_64_TLSDESC as PLT class.
(elf_machine_rel): Handle R_X86_64_TLSDESC.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/x86_64/dl-tls.h (struct dl_tls_index): Name it.
(__tls_get_addr): Do not declare for non-shared compiles.
* sysdeps/x86_64/dl-tlsdesc.S: New file.
* sysdeps/x86_64/dl-tlsdesc.h: New file.
* sysdeps/x86_64/tlsdesc.c: New file.
* sysdeps/x86_64/tlsdesc.sym: New file.
* sysdeps/x86_64/bits/linkmap.h (struct link_map_machine): Add
tlsdesc_table for both 32- and 64-bit structs.
2008-05-13 05:41:30 +00:00
|
|
|
endif
|
2017-09-11 15:18:11 +00:00
|
|
|
|
2021-07-08 20:13:17 +00:00
|
|
|
ifeq ($(subdir),wcsmbs)
|
|
|
|
tests += \
|
|
|
|
tst-rsi-wcslen
|
|
|
|
endif
|
|
|
|
|
2017-09-11 15:18:11 +00:00
|
|
|
$(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os
|
|
|
|
$(make-target-directory)
|
|
|
|
rm -f $@
|
|
|
|
ln $< $@
|
|
|
|
|
|
|
|
do-tests-clean common-mostlyclean: tst-x86_64-1-clean
|
|
|
|
|
|
|
|
.PHONY: tst-x86_64-1-clean
|
|
|
|
tst-x86_64-1-clean:
|
|
|
|
-rm -rf $(objpfx)x86_64
|
2017-10-19 15:28:09 +00:00
|
|
|
|
|
|
|
$(objpfx)x86_64/tst-platformmod-2.os: $(objpfx)tst-platformmod-2.os
|
|
|
|
$(make-target-directory)
|
|
|
|
rm -f $@
|
|
|
|
ln $< $@
|