about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Fix x86 build with --enable-tunable=noAdhemerval Zanella2021-01-142-0/+2
| | | | Checked on x86_64-linux-gnu.
* ifuncmain6pie: Remove the circular IFUNC dependency [BZ #20019]H.J. Lu2021-01-133-15/+9
| | | | | | | | | | | | | | | | On x86, ifuncmain6pie failed with: [hjl@gnu-cfl-2 build-i686-linux]$ ./elf/ifuncmain6pie --direct ./elf/ifuncmain6pie: IFUNC symbol 'foo' referenced in '/export/build/gnu/tools-build/glibc-32bit/build-i686-linux/elf/ifuncmod6.so' is defined in the executable and creates an unsatisfiable circular dependency. [hjl@gnu-cfl-2 build-i686-linux]$ readelf -rW elf/ifuncmod6.so | grep foo 00003ff4 00000706 R_386_GLOB_DAT 0000400c foo_ptr 00003ff8 00000406 R_386_GLOB_DAT 00000000 foo 0000400c 00000401 R_386_32 00000000 foo [hjl@gnu-cfl-2 build-i686-linux]$ Remove non-JUMP_SLOT relocations against foo in ifuncmod6.so, which trigger the circular IFUNC dependency, and build ifuncmain6pie with -Wl,-z,lazy.
* Use the right argument code in unnormal testsSiddhesh Poyarekar2021-01-135-33/+35
| | | | | | Use the right argument code (j) in the unnormal tests and cast inputs from the ieee_long_double_shape_type struct to Float64x to properly test it.
* ldconfig/x86: Store ISA level in cache and aux cacheH.J. Lu2021-01-1326-110/+598
| | | | | | | | | | | Store ISA level in the portion of the unused upper 32 bits of the hwcaps field in cache and the unused pad field in aux cache. ISA level is stored and checked only for shared objects in glibc-hwcaps subdirectories. The shared objects in the default directories aren't checked since there are no fallbacks for these shared objects. Tested on x86-64-v2, x86-64-v3 and x86-64-v4 machines with --disable-hardcoded-path-in-tests and --enable-hardcoded-path-in-tests.
* elf: work around a gcc bug in elf_get_dynamic_infoSzabolcs Nagy2021-01-131-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 2f056e8a5dd4dc0f075413f931e82cede37d1057 "aarch64: define PI_STATIC_AND_HIDDEN", building glibc with gcc-8 on aarch64 fails with /BLD/elf/librtld.os: in function `elf_get_dynamic_info': /SRC/elf/get-dynamic-info.h:70:(.text+0xad8): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against symbol `_rtld_local' defined in .data section in /BLD/elf/librtld.os This is a gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98618 The bug is fixed on gcc-10 and not yet backported. gcc-9 is affected, but the issue happens to not trigger in glibc, gcc-8 and older seems to miscompile rtld.os. Rewriting the affected code in elf_get_dynamic_info seems to make the issue go away on <= gcc-9. The change makes the logic a bit clearer too (by separating the index computation and array update) and drops an older gcc workaround (since gcc 4.6 is no longer supported). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Set header.feature_1 in TCB for always-on CET [BZ #27177]H.J. Lu2021-01-133-1/+11
| | | | | Update dl_cet_check() to set header.feature_1 in TCB when both IBT and SHSTK are always on.
* posix: consume less entropy on tempnameAdhemerval Zanella2021-01-121-3/+14
| | | | | | | | | | The first getrandom is used only for __GT_NOCREATE, which is inherently insecure and can use the entropy as a small improvement. On the second and later attempts it might help against DoS attacks. It sync with gnulib commit 854fbb81d91f7a0f2b463e7ace2499dee2f380f2. Checked on x86_64-linux-gnu.
* Makerules: Do not require startup files for format.lds probe objectFlorian Weimer2021-01-121-3/+2
| | | | | | | | | During statically linked bootstrap, the compiler does not have the required startup files, so do a smaller dummy link to obtain the output format information. Fixes commit 87d583c6e8cd0e49f64da76636ebeec033298b4d ("install: Replace scripts/output-format.sed with objdump -f [BZ #26559]").
* install: Replace scripts/output-format.sed with objdump -f [BZ #26559]Fangrui Song2021-01-116-77/+3
| | | | | | | | | | | | | | GNU ld and gold have supported --print-output-format since 2011. glibc requires binutils>=2.25 (2015), so if LD is GNU ld or gold, we can assume the option is supported. lld is by default a cross linker supporting multiple targets. It auto detects the file format and does not need OUTPUT_FORMAT. It does not support --print-output-format. By parsing objdump -f, we can support all the three linkers. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* math: Add BZ#18980 fix back on dbl-64 coshAdhemerval Zanella2021-01-111-1/+2
| | | | | | | It is regression from 9e97f239eae1f2b1 (Remove dbl-64/wordsize-64 (part 2)) where is missed to add the BZ#18980 fix (9e97f239eae1f2b1). Checked on i686-linux-gnu.
* posix: Sync tempname with gnulib [BZ #26648]Adhemerval Zanella2021-01-111-116/+164
| | | | | | | | It syncs with gnulib commit b1268f22f443e8e4b9e. The try_tempname_len now uses getrandom on each iteration to get entropy and only uses the clock plus ASLR as source of entropy if getrandom fails. Checked on x86_64-linux-gnu and i686-linux-gnu.
* posix: Fix return value of system if shell can not be executed [BZ #27053]Adhemerval Zanella2021-01-113-0/+22
| | | | | | | | POSIX states that system returned code for failure to execute the shell shall be as if the shell had terminated using _exit(127). This behaviour was removed with 5fb7fc96350575. Checked on x86_64-linux-gnu.
* support: Add xchmod wrapperAdhemerval Zanella2021-01-112-0/+31
| | | | Checked on x86_64-linux-gnu.
* Update STATX_ATTR_DAX value from Linux 5.10.Joseph Myers2021-01-111-1/+1
| | | | | | | | This patch updates the value of STATX_ATTR_DAX in bits/statx-generic.h for a change made in Linux 5.10. (As with previous such changes, this only does anything if glibc is being used with old kernel headers.) Tested for x86_64.
* riscv: Initialize $gp before resolving the IRELATIVE relocationVincent Chen2021-01-101-1/+21
| | | | | | | The $gp register may be used to access the global variable in the PDE program, so the $gp register should be initialized before executing the IFUNC resolver of PDE program to avoid unexpected error occurs.
* riscv: support GNU indirect functionVincent Chen2021-01-103-0/+79
| | | | Enable riscv glibc to support GNU indirect function
* posix: Correct attribute access mode on readlinkat [BZ #27024].Martin Sebor2021-01-101-1/+1
|
* Add xfchmod to libsupportAlexandra Hájková2021-01-103-0/+30
|
* Add xchdir to libsupport.Alexandra Hájková2021-01-093-0/+30
|
* POSIX locale: Fix typo in commentMarc Aurèle La France2021-01-091-1/+1
|
* ARC: Regenerate ulpsVineet Gupta2021-01-081-4/+4
| | | | | | | | | | | | | Reinstate pass for FAIL: math/test-double-cosh FAIL: math/test-double-sinh FAIL: math/test-float32x-cosh FAIL: math/test-float32x-sinh FAIL: math/test-float64-cosh FAIL: math/test-float64-sinh FAIL: math/test-ldouble-cosh FAIL: math/test-ldouble-sinh
* mntent: Use __putc_unlocked instead of fputc_unlockedSiddhesh Poyarekar2021-01-081-6/+6
| | | | | | | | __putc_unlocked is guaranteed to be inlined all the time as opposed to fputc_unlocked, which does not get inlined when glibc is built with -Os. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* aarch64: define PI_STATIC_AND_HIDDENSzabolcs Nagy2021-01-082-0/+9
| | | | | | | AArch64 always uses pc relative access to static and hidden object symbols, but the config setting was previously missing. This affects ld.so start up code.
* Update NEWS for CVE-2019-25013.Siddhesh Poyarekar2021-01-081-0/+3
|
* x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717]H.J. Lu2021-01-0721-113/+644
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA levels: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250 and -mneeded to emit GNU_PROPERTY_X86_ISA_1_NEEDED property with GNU_PROPERTY_X86_ISA_1_V[234] marker: https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13 Binutils support for GNU_PROPERTY_X86_ISA_1_V[234] marker were added by commit b0ab06937385e0ae25cebf1991787d64f439bf12 Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Oct 30 06:49:57 2020 -0700 x86: Support GNU_PROPERTY_X86_ISA_1_BASELINE marker and commit 32930e4edbc06bc6f10c435dbcc63131715df678 Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Oct 9 05:05:57 2020 -0700 x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker GNU_PROPERTY_X86_ISA_1_NEEDED property in x86 ELF binaries indicate the micro-architecture ISA level required to execute the binary. The marker must be added by programmers explicitly in one of 3 ways: 1. Pass -mneeded to GCC. 2. Add the marker in the linker inputs as this patch does. 3. Pass -z x86-64-v[234] to the linker. Add GNU_PROPERTY_X86_ISA_1_BASELINE and GNU_PROPERTY_X86_ISA_1_V[234] marker support to ld.so if binutils 2.32 or newer is used to build glibc: 1. Add GNU_PROPERTY_X86_ISA_1_BASELINE and GNU_PROPERTY_X86_ISA_1_V[234] markers to elf.h. 2. Add GNU_PROPERTY_X86_ISA_1_BASELINE and GNU_PROPERTY_X86_ISA_1_V[234] marker to abi-note.o based on the ISA level used to compile abi-note.o, assuming that the same ISA level is used to compile the whole glibc. 3. Add isa_1 to cpu_features to record the supported x86 ISA level. 4. Rename _dl_process_cet_property_note to _dl_process_property_note and add GNU_PROPERTY_X86_ISA_1_V[234] marker detection. 5. Update _rtld_main_check and _dl_open_check to check loaded objects with the incompatible ISA level. 6. Add a testcase to verify that dlopen an x86-64-v4 shared object fails on lesser platforms. 7. Use <get-isa-level.h> in dl-hwcaps-subdirs.c and tst-glibc-hwcaps.c. Tested under i686, x32 and x86-64 modes on x86-64-v2, x86-64-v3 and x86-64-v4 machines. Marked elf/tst-isa-level-1 with x86-64-v4, ran it on x86-64-v3 machine and got: [hjl@gnu-cfl-2 build-x86_64-linux]$ ./elf/tst-isa-level-1 ./elf/tst-isa-level-1: CPU ISA level is lower than required [hjl@gnu-cfl-2 build-x86_64-linux]$
* Remove dbl-64/wordsize-64 (part 2)Wilco Dijkstra2021-01-0740-1843/+422
| | | | | | | | Remove the wordsize-64 implementations by merging them into the main dbl-64 directory. The second patch just moves all wordsize-64 files and removes a few wordsize-64 uses in comments and Implies files. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Remove dbl-64/wordsize-64Wilco Dijkstra2021-01-074-4/+31
| | | | | | | | | | Remove the wordsize-64 implementations by merging them into the main dbl-64 directory. The first patch adds special cases needed for 32-bit targets (FIX_INT_FP_CONVERT_ZERO and FIX_DBL_LONG_CONVERT_OVERFLOW) to the wordsize-64 versions. This has no effect on 64-bit targets since they don't define these macros. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Add SEGV_MTEAERR and SEGV_MTESERR from Linux 5.10.Joseph Myers2021-01-061-1/+5
| | | | | | | Linux 5.10 adds constants SEGV_MTEAERR and SEGV_MTESERR to asm-generic/siginfo.h. Add these to glibc's bits/siginfo-consts.h. Tested for x86_64.
* support: Add support_small_thread_stack_sizeAdhemerval Zanella2021-01-052-3/+11
| | | | | It returns the minimum stack size large enough to cover most internal glibc stack usage.
* stdlib: Sync canonicalize with gnulib [BZ #10635] [BZ #26592] [BZ #26341] ↵Adhemerval Zanella2021-01-053-171/+389
| | | | | | | | | | | | | | | | | | | | | | | | [BZ #24970] It sync with gnulib version ae9fb3d66. The testcase for BZ#23741 (stdlib/test-bz22786.c) is adjusted to check also for ENOMEM. The patch fixes multiple realpath issues: - Portability fixes for errno clobbering on free (BZ#10635). The function does not call free directly anymore, although it might be done through scratch_buffer_free. The free errno clobbering is being tracked by BZ#17924. - Pointer arithmetic overflows in realpath (BZ#26592). - Realpath cyclically call __alloca(path_max) to consume too much stack space (BZ#26341). - Realpath mishandles EOVERFLOW; stat not needed anyway (BZ#24970). The check is done through faccessat now. Checked on x86_64-linux-gnu and i686-linux-gnu.
* malloc: Add scratch_buffer_dupfreeAdhemerval Zanella2021-01-055-2/+83
| | | | | It returns a copy of the buffer up to a defined size. It will be used on realpath sync with gnulib.
* Import filename.h from gnulibAdhemerval Zanella2021-01-051-0/+112
| | | | And use to simplify stdlib/canonicalize.c implementation.
* Import idx.h from gnulibAdhemerval Zanella2021-01-051-0/+114
| | | | And use to simplify stdlib/canonicalize.c implementation.
* alpha: Provide wait4 for static library [BZ #27150]Adhemerval Zanella2021-01-051-0/+2
| | | | | | | | This ia regression from 09153638cfef91, versioned_symbol acts as weak_alias for !SHARED but it is undefined to avoid non versioned alias from the generic implementation. Checked with a build for alpha-linux-gnu.
* aarch64: push the set of rules before falling into slow pathShuo Wang2021-01-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is supposed to save the rules for the instructions before falling into slow path. Tested in glibc-2.28 before fixing: Thread 2 "xxxxxxx" hit Breakpoint 1, _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:149 149 stp x1, x2, [sp, #-32]! Missing separate debuginfos, use: dnf debuginfo-install libgcc-7.3.0-20190804.h24.aarch64 (gdb) ni _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:150 150 stp x3, x4, [sp, #16] (gdb) _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:157 157 mrs x4, tpidr_el0 (gdb) 158 ldr PTR_REG (1), [x0,#TLSDESC_ARG] (gdb) 159 ldr PTR_REG (0), [x4,#TCBHEAD_DTV] (gdb) 160 ldr PTR_REG (3), [x1,#TLSDESC_GEN_COUNT] (gdb) 161 ldr PTR_REG (2), [x0,#DTV_COUNTER] (gdb) 162 cmp PTR_REG (3), PTR_REG (2) (gdb) 163 b.hi 2f (gdb) 165 ldp PTR_REG (2), PTR_REG (3), [x1,#TLSDESC_MODID] (gdb) 166 add PTR_REG (0), PTR_REG (0), PTR_REG (2), lsl #(PTR_LOG_SIZE + 1) (gdb) 167 ldr PTR_REG (0), [x0] /* Load val member of DTV entry. */ (gdb) 168 cmp PTR_REG (0), #TLS_DTV_UNALLOCATED (gdb) 169 b.eq 2f (gdb) bt #0 _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:169 #1 0x0000ffffbe4fbb44 in OurFunction (threadId=4294967295) at /home/test/test_function.c:30 #2 0x0000000000400c08 in initaaa () at thread.c:58 #3 0x0000000000400c50 in thread_proc (param=0x0) at thread.c:71 #4 0x0000ffffbf6918bc in start_thread (arg=0xfffffffff29f) at pthread_create.c:486 #5 0x0000ffffbf5669ec in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78 (gdb) ni _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:184 184 stp x29, x30, [sp,#-16*NSAVEXREGPAIRS]! (gdb) bt #0 _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:184 #1 0x0000ffffbe4fbb44 in OurFunction (threadId=4294967295) at /home/test/test_function.c:30 #2 0x0000000000000000 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) Co-authored-by: liqingqing <liqingqing3@huawei.com>
* nptl: Fix comment typo in pthread_cond_wait.cJangwoong Kim2021-01-041-1/+1
|
* x86: Check IFUNC definition in unrelocated executable [BZ #20019]H.J. Lu2021-01-042-10/+22
| | | | | | Calling an IFUNC function defined in unrelocated executable also leads to segfault. Issue a fatal error message when calling IFUNC function defined in the unrelocated executable from a shared library.
* hurd: Fix mmap(!MAP_FIXED) on bogus addressSamuel Thibault2021-01-041-3/+6
| | | | | | | | In the !MAP_FIXED case, when a bogus address is given mmap should pick up a valide address rather than returning EINVAL: Posix only talks about EINVAL for the MAP_FIXED case. This fixes long-running ghc processes.
* x86-64: Avoid rep movsb with short distance [BZ #27130]H.J. Lu2021-01-041-0/+21
| | | | | | | | | | | | | | | | | When copying with "rep movsb", if the distance between source and destination is N*4GB + [1..63] with N >= 0, performance may be very slow. This patch updates memmove-vec-unaligned-erms.S for AVX and AVX512 versions with the distance in RCX: cmpl $63, %ecx // Don't use "rep movsb" if ECX <= 63 jbe L(Don't use rep movsb") Use "rep movsb" Benchtests data with bench-memcpy, bench-memcpy-large, bench-memcpy-random and bench-memcpy-walk on Skylake, Ice Lake and Tiger Lake show that its performance impact is within noise range as "rep movsb" is only used for data size >= 4KB.
* aarch64: fix stack missing after sp is updatedShuo Wang2021-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After sp is updated, the CFA offset should be set before next instruction. Tested in glibc-2.28: Thread 2 "xxxxxxx" hit Breakpoint 1, _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:149 149 stp x1, x2, [sp, #-32]! Missing separate debuginfos, use: dnf debuginfo-install libgcc-7.3.0-20190804.h24.aarch64 (gdb) bt #0 _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:149 #1 0x0000ffffbe4fbb44 in OurFunction (threadId=3194870184) at /home/test/test_function.c:30 #2 0x0000000000400c08 in initaaa () at thread.c:58 #3 0x0000000000400c50 in thread_proc (param=0x0) at thread.c:71 #4 0x0000ffffbf6918bc in start_thread (arg=0xfffffffff29f) at pthread_create.c:486 #5 0x0000ffffbf5669ec in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78 (gdb) ni _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:150 150 stp x3, x4, [sp, #16] (gdb) bt #0 _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:150 #1 0x0000ffffbe4fbb44 in OurFunction (threadId=3194870184) at /home/test/test_function.c:30 #2 0x0000000000000000 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) ni _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:157 157 mrs x4, tpidr_el0 (gdb) bt #0 _dl_tlsdesc_dynamic () at ../sysdeps/aarch64/dl-tlsdesc.S:157 #1 0x0000ffffbe4fbb44 in OurFunction (threadId=3194870184) at /home/test/test_function.c:30 #2 0x0000000000400c08 in initaaa () at thread.c:58 #3 0x0000000000400c50 in thread_proc (param=0x0) at thread.c:71 #4 0x0000ffffbf6918bc in start_thread (arg=0xfffffffff29f) at pthread_create.c:486 #5 0x0000ffffbf5669ec in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78 Signed-off-by: liqingqing <liqingqing3@huawei.com> Signed-off-by: Shuo Wang <wangshuo47@huawei.com>
* nptl: Remove set*id, set*gid files which are not builtFlorian Weimer2021-01-049-28/+0
|
* Drop nan-pseudo-number.h usage from testsSiddhesh Poyarekar2021-01-047-15/+11
| | | | | | | | | | Make the tests use TEST_COND_intel96 to decide on whether to build the unnormal tests instead of the macro in nan-pseudo-number.h and then drop the header inclusion. This unbreaks test runs on all architectures that do not have ldbl-96. Also drop the HANDLE_PSEUDO_NUMBERS macro since it is not used anywhere.
* posix: Sync fnmatch with gnulibAdhemerval Zanella2021-01-042-1317/+1208
| | | | | | It sync with gnulib commit 43ee1a6bf. Checked on x86_64-linux-gnu.
* Sync flexmember.h with gnulibAdhemerval Zanella2021-01-041-5/+20
| | | | It sync with gnulib commit 43ee1a6bf.
* Sync intprops.h with gnulibAdhemerval Zanella2021-01-041-12/+58
| | | | | | It sync with gnulib commit 43ee1a6bf. Checked on x86_64-linux-gnu.
* posix: Sync glob code with gnulibAdhemerval Zanella2021-01-043-866/+886
| | | | | | | It sync with gnulib commit 43ee1a6bf and fixes and use-after-free bug (gnulib commit 717766da8926e36). Checked on x86_64-linux-gnu.
* posix: Sync regex code with gnulibAdhemerval Zanella2021-01-044-19/+35
| | | | | | | It sync with gnulib commit 43ee1a6bf. The main change is 9682f18e9. (which does not have a meaniful description). Checked on x86_64-linux-gnu.
* Move generic nan-pseudo-number.h to ldbl-96Siddhesh Poyarekar2021-01-041-0/+0
| | | | | The concept of pseudo number formats only exists in the realm of the 96 bit long double format.
* Sync FDL from https://www.gnu.org/licenses/fdl-1.3.texiPaul Eggert2021-01-021-3/+3
|
* Sync move-if-change from GnulibPaul Eggert2021-01-021-2/+3
| | | | | | This alters move-if-change so that its --version option outputs the correct copyright date automatically. One less thing to update by hand.