Commit Graph

38694 Commits

Author SHA1 Message Date
Sunil K Pandey
bef2d0ec25 x86-64: Add vector asinh/asinhf to libmvec microbenchmark
Add vector asinh/asinhf and input files to libmvec microbenchmark.

libmvec-asinh-inputs:
  90% Normal random distribution
  range: (-DBL_MAX, DBL_MAX)
  mean: 0.0
  sigma: 2.0
  10% uniform random distribution in range (-1.0e6, 1.0e6)

libmvec-asinhf-inputs:
  90% Normal random distribution
  range: (-FLT_MAX, FLT_MAX)
  mean: 0.0f
  sigma: 2.0f
  10% uniform random distribution in range (-1.0e6f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:37:01 -08:00
Sunil K Pandey
b263a0155e x86-64: Add vector tanh/tanhf to libmvec microbenchmark
Add vector tanh/tanhf and input files to libmvec microbenchmark.

libmvec-tanh-inputs:
  90% Normal random distribution
  range: (-19.0, 19.0)
  mean: 0.0
  sigma: 2.0
  10% uniform random distribution in range (-16.0, 16.0)

libmvec-tanhf-inputs:
  90% Normal random distribution
  range: (-10.0f, 10.0f)
  mean: 0.0f
  sigma: 2.0f
  10% uniform random distribution in range (-8.0f, 8.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:56 -08:00
Sunil K Pandey
475ed201c2 x86-64: Add vector erf/erff to libmvec microbenchmark
Add vector erf/erff and input files to libmvec microbenchmark.

libmvec-erf-inputs:
  90% Normal random distribution
  range: (-6.0, 6.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-5.9, 5.9)

libmvec-erff-inputs:
  90% Normal random distribution
  range: (-4.0f, 4.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-3.9f, 3.9f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:51 -08:00
Sunil K Pandey
157bdb5f89 x86-64: Add vector acosh/acoshf to libmvec microbenchmark
Add vector acosh/acoshf and input files to libmvec microbenchmark.

libmvec-acosh-inputs:
  90% Normal random distribution
  range: (1.0, DBL_MAX)
  mean: 1.0
  sigma: 8.0
  10% uniform random distribution in range (1.0, 1.0e6)

libmvec-acoshf-inputs:
  90% Normal random distribution
  range: (1.0f, FLT_MAX)
  mean: 1.0f
  sigma: 4.0f
  10% uniform random distribution in range (1.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:46 -08:00
Sunil K Pandey
0050c9a45d x86-64: Add vector atanh/atanhf to libmvec microbenchmark
Add vector atanh/atanhf and input files to libmvec microbenchmark.

libmvec-atanh-inputs:
  90% Normal random distribution
  range: (-1.0, 1.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-1.0, 1.0)

libmvec-atanhf-inputs:
  90% Normal random distribution
  range: (-1.0f, 1.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-1.0f, 1.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:41 -08:00
Sunil K Pandey
171817d8c0 x86-64: Add vector log1p/log1pf to libmvec microbenchmark
Add vector log1p/log1pf and input files to libmvec microbenchmark.

libmvec-log1p-inputs:
  70% Normal random distribution
  range: (-1.0, DBL_MAX)
  mean: 0.0
  sigma: 50.0
  30% uniform random distribution in range (-1.0, 1.0e6)

libmvec-log1pf-inputs:
  70% Normal random distribution
  range: (-1.0f, FLT_MAX)
  mean: 0.0f
  sigma: 50.0f
  30% uniform random distribution in range (-1.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:36 -08:00
Sunil K Pandey
b6b2be5c2f x86-64: Add vector log2/log2f to libmvec microbenchmark
Add vector log2/log2f and input files to libmvec microbenchmark.

libmvec-log2-inputs:
  70% Normal random distribution
  range: (0.0, DBL_MAX)
  mean: 1.0
  sigma: 50.0
  30% uniform random distribution in range (0.0, 1.0e6)

libmvec-log2f-inputs:
  70% Normal random distribution
  range: (0.0f, FLT_MAX)
  mean: 1.0f
  sigma: 50.0f
  30% uniform random distribution in range (0.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:31 -08:00
Sunil K Pandey
e43b757e06 x86-64: Add vector log10/log10f to libmvec microbenchmark
Add vector log10/log10f and input files to libmvec microbenchmark.

libmvec-log10-inputs:
  70% Normal random distribution
  range: (0.0, DBL_MAX)
  mean: 1.0
  sigma: 50.0
  30% uniform random distribution in range (0.0, 1.0e6)

libmvec-log10f-inputs:
  70% Normal random distribution
  range: (0.0f, FLT_MAX)
  mean: 1.0f
  sigma: 50.0f
  30% uniform random distribution in range (0.0f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:23 -08:00
Sunil K Pandey
16aec30154 x86-64: Add vector atan2/atan2f to libmvec microbenchmark
Add vector atan2/atan2f and input files to libmvec microbenchmark.

libmvec-atan2-inputs:
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)
  arg2:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)

libmvec-atan2f-inputs:
  arg1:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)
  arg2:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:14 -08:00
Sunil K Pandey
fec48238b2 x86-64: Add vector cbrt/cbrtf to libmvec microbenchmark
Add vector cbrt/cbrtf and input files to libmvec microbenchmark.

libmvec-cbrt-inputs:
  90% Normal random distribution
  range: (-DBL_MAX, DBL_MAX)
  mean: 0.0
  sigma: 10.0
  10% uniform random distribution in range (-1000.0, 1000.0)

libmvec-cbrtf-inputs:
  90% Normal random distribution
  range: (-FLT_MAX, FLT_MAX)
  mean: 0.0f
  sigma: 10.0f
  10% uniform random distribution in range (-1000.0f, 1000.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:06 -08:00
Sunil K Pandey
6acc09c589 x86-64: Add vector sinh/sinhf to libmvec microbenchmark
Add vector sinh/sinhf and input files to libmvec microbenchmark.

libmvec-sinh-inputs:
  90% Normal random distribution
  range: (-710.0, 710.0)
  mean: 0.0
  sigma: 32.0
  10% uniform random distribution in range (-500.0, 500.0)

libmvec-sinhf-inputs:
  90% Normal random distribution
  range: (-89.0f, 89.0f)
  mean: 0.0f
  sigma: 16.0f
  10% uniform random distribution in range (-50.0f, 50.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:36:00 -08:00
Sunil K Pandey
049555aad4 x86-64: Add vector expm1/expm1f to libmvec microbenchmark
Add vector expm1/expm1f and input files to libmvec microbenchmark.

libmvec-expm1-inputs:
  90% Normal random distribution
  range: (-708.0, 709.0)
  mean: 0.0
  sigma: 16.0
  10% uniform random distribution in range (-500.0, 500.0)

libmvec-expm1f-inputs:
  90% Normal random distribution
  range: (-87.0f, 88.0f)
  mean: 0.0f
  sigma: 8.0f
  10% uniform random distribution in range (-50.0f, 50.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:35:54 -08:00
Sunil K Pandey
54cf4f31fe x86-64: Add vector cosh/coshf to libmvec microbenchmark
Add vector cosh/coshf and input files to libmvec microbenchmark.

libmvec-cosh-inputs:
  90% Normal random distribution
  range: (-710.0, 710.0)
  mean: 0.0
  sigma: 32.0
  10% uniform random distribution in range (-500.0, 500.0)

libmvec-coshf-inputs:
  90% Normal random distribution
  range: (-89.0f, 89.0f)
  mean: 0.0f
  sigma: 16.0f
  10% uniform random distribution in range (-50.0f, 50.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:35:49 -08:00
Sunil K Pandey
abebb26108 x86-64: Add vector exp10/exp10f to libmvec microbenchmark
Add vector exp10/exp10f and input files to libmvec microbenchmark.

libmvec-exp10-inputs:
  90% Normal random distribution
  range: (-307.0, 308.0)
  mean: 0.0
  sigma: 16.0
  10% uniform random distribution in range (-250.0, 250.0)

libmvec-exp10f-inputs:
  90% Normal random distribution
  range: (-37.0f, 38.0f)
  mean: 0.0f
  sigma: 8.0f
  10% uniform random distribution in range (-25.0f, 25.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:35:43 -08:00
Sunil K Pandey
b0e4360778 x86-64: Add vector exp2/exp2f to libmvec microbenchmark
Add vector exp2/exp2f and input files to libmvec microbenchmark.

libmvec-exp2-inputs:
  90% Normal random distribution
  range: (-1022.0, 1024.0)
  mean: 0.0
  sigma: 16.0
  10% uniform random distribution in range (-1000.0, 1000.0)

libmvec-exp2f-inputs:
  90% Normal random distribution
  range: (-126.0f, 128.0f)
  mean: 0.0f
  sigma: 8.0f
  10% uniform random distribution in range (-100.0f, 100.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:35:34 -08:00
Sunil K Pandey
b0a1107042 x86-64: Add vector hypot/hypotf to libmvec microbenchmark
Add vector hypot/hypotf and input files to libmvec microbenchmark.

libmvec-hypot-inputs:
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 10.0
    10% uniform random distribution in range (-1000.0, 1000.0)
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 10.0
    10% uniform random distribution in range (-1000.0, 1000.0)

libmvec-hypotf-inputs:
  arg1:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 10.0f
    10% uniform random distribution in range (-1000.0f, 1000.0f)
  arg2:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 10.0f
    10% uniform random distribution in range (-1000.0f, 1000.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:35:16 -08:00
Sunil K Pandey
e96f25427c x86-64: Add vector asin/asinf to libmvec microbenchmark
Add vector asin/asinf and input files to libmvec microbenchmark.

libmvec-asin-inputs:
  90% Normal random distribution
  range: (-1.0, 1.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-1.0, 1.0)

libmvec-asinf-inputs:
  90% Normal random distribution
  range: (-1.0f, 1.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-1.0f, 1.0f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:35:11 -08:00
Sunil K Pandey
7e05d94ea1 x86-64: Add vector atan/atanf to libmvec microbenchmark
Add vector atan/atanf and input files to libmvec microbenchmark.

libmvec-atan-inputs:
  arg1:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)
  arg2:
    90% Normal random distribution
    range: (-DBL_MAX, DBL_MAX)
    mean: 0.0
    sigma: 4.0
    10% uniform random distribution in range (-1.0e6, 1.0e6)

libmvec-atanf-inputs:
  arg1:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)
  arg2:
    90% Normal random distribution
    range: (-FLT_MAX, FLT_MAX)
    mean: 0.0f
    sigma: 4.0f
    10% uniform random distribution in range (-1.0e6f, 1.0e6f)

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-06 12:24:32 -08:00
H.J. Lu
fa7ad1df19 elf: Replace tst-audit24bmod2.so with tst-audit24bmod2
Replace tst-audit24bmod2.so with tst-audit24bmod2 to silence:

make[2]: Entering directory '/export/gnu/import/git/gitlab/x86-glibc/elf'
Makefile:2201: warning: overriding recipe for target '/export/build/gnu/tools-build/glibc-gitlab/build-x86_64-linux/elf/tst-audit24bmod2.so'
../Makerules:765: warning: ignoring old recipe for target '/export/build/gnu/tools-build/glibc-gitlab/build-x86_64-linux/elf/tst-audit24bmod2.so'
2022-02-06 11:12:24 -08:00
H.J. Lu
c328d0152d x86_64/multiarch: Sort sysdep_routines and put one entry per line 2022-02-05 16:42:17 -08:00
H.J. Lu
a007ec4669 string: Sort headers, routines, tests and tests-translation
Sort headers, routines, tests and tests-translation.  Put one entry per
line.
2022-02-05 16:42:17 -08:00
H.J. Lu
1283948f23 x86: Improve L to support L(XXX_SYMBOL (YYY, ZZZ)) 2022-02-05 16:42:17 -08:00
Noah Goldstein
90cbb80636 Benchtests: move 'alloc_bufs' from loop in bench-memset.c
One buf allocation is sufficient. Calling `alloc_bufs' in the loop
just adds unnecessary syscall overhead.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2022-02-05 16:48:00 -06:00
H.J. Lu
0e0199a9e0 x86-64: Fix strcmp-evex.S
Change "movl %edx, %rdx" to "movl %edx, %edx" in:

commit 8418eb3ff4
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Mon Jan 10 15:35:39 2022 -0600

    x86: Optimize strcmp-evex.S
2022-02-04 11:11:08 -08:00
H.J. Lu
c15efd011c x86-64: Fix strcmp-avx2.S
Change "movl %edx, %rdx" to "movl %edx, %edx" in:

commit b77b06e0e2
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Mon Jan 10 15:35:38 2022 -0600

    x86: Optimize strcmp-avx2.S
2022-02-04 11:09:10 -08:00
Sunil K Pandey
811124ce08 x86-64: Add vector acos/acosf to libmvec microbenchmark
Add vector acos/acosf and input files to libmvec microbenchmark.

libmvec-acos-inputs:
  90% Normal random distribution
  range: (-1.0, 1.0)
  mean: 0.0
  sigma: 1.0
  10% uniform random distribution in range (-1.0, 1.0)

libmvec-acosf-inputs:
  90% Normal random distribution
  range: (-1.0f, 1.0f)
  mean: 0.0f
  sigma: 1.0f
  10% uniform random distribution in range (-1.0f, 1.0f)

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2022-02-03 17:37:06 -08:00
Noah Goldstein
80e6c6554b benchtests: Add more coverage for strcmp and strncmp benchmarks
Add more small and medium sized tests for strcmp and strncmp.

As well for strcmp add option for more direct control of
alignment. Previously alignment was being pushed to the end of the
page. While this is the most difficult case to implement, it is far
from the common case and so shouldn't be the only benchmark.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2022-02-03 16:41:43 -06:00
Noah Goldstein
8418eb3ff4 x86: Optimize strcmp-evex.S
Optimization are primarily to the loop logic and how the page cross
logic interacts with the loop.

The page cross logic is at times more expensive for short strings near
the end of a page but not crossing the page. This is done to retest
the page cross conditions with a non-faulty check and to improve the
logic for entering the loop afterwards. This is only particular cases,
however, and is general made up for by more than 10x improvements on
the transition from the page cross -> loop case.

The non-page cross cases as well are nearly universally improved.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2022-02-03 16:41:41 -06:00
Noah Goldstein
b77b06e0e2 x86: Optimize strcmp-avx2.S
Optimization are primarily to the loop logic and how the page cross
logic interacts with the loop.

The page cross logic is at times more expensive for short strings near
the end of a page but not crossing the page. This is done to retest
the page cross conditions with a non-faulty check and to improve the
logic for entering the loop afterwards. This is only particular cases,
however, and is general made up for by more than 10x improvements on
the transition from the page cross -> loop case.

The non-page cross cases are improved most for smaller sizes [0, 128]
and go about even for (128, 4096]. The loop page cross logic is
improved so some more significant speedup is seen there as well.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2022-02-03 16:41:38 -06:00
Noah Goldstein
1a908d9074 string: Improve coverage in test-strcmp.c and test-strncmp.c
Add additional test cases for small / medium sizes.

Add tests in test-strncmp.c where `n` is near ULONG_MAX or LONG_MIN to
test for overflow bugs in length handling.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2022-02-03 16:41:36 -06:00
Noah Goldstein
43388b3ac0 string/test-str*cmp: remove stupid_[strcmp, strncmp, wcscmp, wcsncmp].
These implementations just add to test duration. Since we have
simple_* implementations we already have a safe reference
implementation.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
2022-02-03 16:41:34 -06:00
Adhemerval Zanella
798d716df7 linux: Fix missing __convert_scm_timestamps (BZ #28860)
Commit 948ce73b31 made recvmsg/recvmmsg to always call
__convert_scm_timestamps for 64 bit time_t symbol, so adjust it to
always build it for __TIMESIZE != 64.

It fixes build for architecture with 32 bit time_t support when
configured with minimum kernel of 5.1.
2022-02-03 16:59:16 -03:00
Gleb Fotengauer-Malinovskiy
97ba273b50 linux: __get_nprocs_sched: do not feed CPU_COUNT_S with garbage [BZ #28850]
Pass the actual number of bytes returned by the kernel.

Fixes: 33099d72e4 ("linux: Simplify get_nprocs")
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2022-02-03 11:04:08 +00:00
Adhemerval Zanella
a9d3576572 posix: Fix tst-spawn6 terminal handling (BZ #28853)
The test changes the current foreground process group, which might
break testing depending of how the make check is issued.  For instance:

  nohup make -j1 test t=posix/tst-spawn6 | less

Will set 'make' and 'less' to be in the foreground process group in
the current session.  When tst-spawn6 new child takes over it becomes
the foreground process and 'less' is stopped and backgrounded which
interrupts the 'make check' command.

To fix it a pseudo-terminal is allocated, the test starts in new
session (so there is no controlling terminal associated), and the
pseudo-terminal is set as the controlling one (similar to what
login_tty does).

Checked on x86_64-linux-gnu.

Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-02-03 08:04:08 -03:00
Andreas Schwab
e8faf48321 Regenerate configure 2022-02-03 09:35:38 +01:00
Carlos O'Donell
bc6c1af537 Open master branch for glibc 2.36 development 2022-02-03 01:21:33 -05:00
Carlos O'Donell
f94f6d8a35 Create ChangeLog.old/ChangeLog.24. 2022-02-03 00:27:54 -05:00
Carlos O'Donell
e0f3c52a3f Prepare for glibc 2.35 release.
Update version.h, and include/features.h.
2022-02-03 00:23:26 -05:00
Carlos O'Donell
e0beb0c9f1 Regenerate configure. 2022-02-03 00:10:03 -05:00
Carlos O'Donell
6415fd2ddc Update install.texi, and regenerate INSTALL. 2022-02-03 00:06:38 -05:00
Carlos O'Donell
a134ce8237 Update NEWS bug list. 2022-02-02 23:55:20 -05:00
Carlos O'Donell
32ffd42741 Update NEWS.
Moved LD_AUDIT notes into requirements section since the LAV_CURRENT
bump is a requirements change that impacts loading old audit modules
or new audit modules on older loaders.
2022-02-02 23:46:19 -05:00
Carlos O'Donell
fbc14ab6f0 Update translations. 2022-02-02 23:30:15 -05:00
Florian Weimer
6c33b01843 Linux: Use ptrdiff_t for __rseq_offset
This matches the data size initial-exec relocations use on most
targets.

Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-02-02 22:37:20 +01:00
Szabolcs Nagy
80a08d0faa Fix elf/tst-audit25a with default bind now toolchains
This test relies on lazy binding for the executable so request that
explicitly in case the toolchain defaults to bind now.
2022-02-02 14:03:58 +00:00
Adhemerval Zanella
6289d28d3c posix: Replace posix_spawnattr_tc{get,set}pgrp_np with posix_spawn_file_actions_addtcsetpgrp_np
The posix_spawnattr_tcsetpgrp_np works on a file descriptor (the
controlling terminal), so it would make more sense to actually fit
it on the file actions API.

Also, POSIX_SPAWN_TCSETPGROUP is not really required since it is
implicit by the presence of tcsetpgrp file action.

The posix/tst-spawn6.c is also fixed when TTY can is not present.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2022-02-02 08:34:16 -03:00
Stafford Horne
3f35e7d193 or1k: Define PI_STATIC_AND_HIDDEN
PI_STATIC_AND_HIDDEN means that references to static functions, data
and symbols with hidden visibility do not need any run-time relocations
after the final link, with the build flags used by glibc.

OpenRISC follows this so enabled PI_STATIC_AND_HIDDEN by adding
configure.ac and generating configure.

Suggested-by: Florian Weimer <fweimer@redhat.com>
2022-02-02 20:05:12 +09:00
Samuel Thibault
355bc7f736 SET_RELHOOK: merge i386 and x86_64, and move to sysdeps/mach/hurd/x86
It is not Hurd-specific, but H.J. Lu wants it there.

Also, dc.a can be used to avoid hardcoding .long vs .quad and thus use
the same implementation for i386 and x86_64.
2022-02-01 20:08:25 +00:00
Ben Woodard
ce9a68c57c elf: Fix runtime linker auditing on aarch64 (BZ #26643)
The rtld audit support show two problems on aarch64:

  1. _dl_runtime_resolve does not preserve x8, the indirect result
      location register, which might generate wrong result calls
      depending of the function signature.

  2. The NEON Q registers pushed onto the stack by _dl_runtime_resolve
     were twice the size of D registers extracted from the stack frame by
     _dl_runtime_profile.

While 2. might result in wrong information passed on the PLT tracing,
1. generates wrong runtime behaviour.

The aarch64 rtld audit support is changed to:

  * Both La_aarch64_regs and La_aarch64_retval are expanded to include
    both x8 and the full sized NEON V registers, as defined by the
    ABI.

  * dl_runtime_profile needed to extract registers saved by
    _dl_runtime_resolve and put them into the new correctly sized
    La_aarch64_regs structure.

  * The LAV_CURRENT check is change to only accept new audit modules
    to avoid the undefined behavior of not save/restore x8.

  * Different than other architectures, audit modules older than
    LAV_CURRENT are rejected (both La_aarch64_regs and La_aarch64_retval
    changed their layout and there are no requirements to support multiple
    audit interface with the inherent aarch64 issues).

  * A new field is also reserved on both La_aarch64_regs and
    La_aarch64_retval to support variant pcs symbols.

Similar to x86, a new La_aarch64_vector type to represent the NEON
register is added on the La_aarch64_regs (so each type can be accessed
directly).

Since LAV_CURRENT was already bumped to support bind-now, there is
no need to increase it again.

Checked on aarch64-linux-gnu.

Co-authored-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2022-02-01 14:49:46 -03:00
Adhemerval Zanella
32612615c5 elf: Issue la_symbind for bind-now (BZ #23734)
The audit symbind callback is not called for binaries built with
-Wl,-z,now or when LD_BIND_NOW=1 is used, nor the PLT tracking callbacks
(plt_enter and plt_exit) since this would change the expected
program semantics (where no PLT is expected) and would have performance
implications (such as for BZ#15533).

LAV_CURRENT is also bumped to indicate the audit ABI change (where
la_symbind flags are set by the loader to indicate no possible PLT
trace).

To handle powerpc64 ELFv1 function descriptor, _dl_audit_symbind
requires to know whether bind-now is used so the symbol value is
updated to function text segment instead of the OPD (for lazy binding
this is done by PPC64_LOAD_FUNCPTR on _dl_runtime_resolve).

Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,
powerpc64-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2022-02-01 14:49:46 -03:00