View Bazaar branches
Get this repository:
git clone https://git.launchpad.net/glibc

Import details

Import Status: Reviewed

This repository is an import of the Git repository at git://sourceware.org/git/glibc.git.

The next import is scheduled to run .

Last successful import was .

Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 12 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-15 and finished taking 4 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-15 and finished taking 4 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 4 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 4 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 4 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-12 and finished taking 5 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 5 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 8 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 4 minutes — see the log

Branches

Name Last Modified Last Commit
master 2021-10-22 13:46:49 UTC
x86_64: Add missing libmvec ABI tests

Author: Sunil K Pandey
Author Date: 2021-10-13 20:37:24 UTC

x86_64: Add missing libmvec ABI tests

Add vector ABI tests for cos, exp, log, pow and sin functions.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

maskray/clang 2021-10-20 21:22:56 UTC
stdlib/longlong.h: Remove incorrect lvalue to rvalue conversion from asm outp...

Author: Fangrui Song
Author Date: 2021-10-10 23:06:14 UTC

stdlib/longlong.h: Remove incorrect lvalue to rvalue conversion from asm output constraints

An output constraint takes a lvalue. While GCC happily strips the
incorrect lvalue to rvalue conversion, Clang rejects the code by
default:

    error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions

release/2.34/master 2021-10-19 12:21:14 UTC
elf: Avoid deadlock between pthread_create and ctors [BZ #28357]

Author: Szabolcs Nagy
Author Date: 2021-09-15 14:16:19 UTC

elf: Avoid deadlock between pthread_create and ctors [BZ #28357]

The fix for bug 19329 caused a regression such that pthread_create can
deadlock when concurrent ctors from dlopen are waiting for it to finish.
Use a new GL(dl_load_tls_lock) in pthread_create that is not taken
around ctors in dlopen.

The new lock is also used in __tls_get_addr instead of GL(dl_load_lock).

The new lock is held in _dl_open_worker and _dl_close_worker around
most of the logic before/after the init/fini routines. When init/fini
routines are running then TLS is in a consistent, usable state.
In _dl_open_worker the new lock requires catching and reraising dlopen
failures that happen in the critical section.

The new lock is reinitialized in a fork child, to keep the existing
behaviour and it is kept recursive in case malloc interposition or TLS
access from signal handlers can retake it. It is not obvious if this
is necessary or helps, but avoids changing the preexisting behaviour.

The new lock may be more appropriate for dl_iterate_phdr too than
GL(dl_load_write_lock), since TLS state of an incompletely loaded
module may be accessed. If the new lock can replace the old one,
that can be a separate change.

Fixes bug 28357.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 83b5323261bb72313bffcf37476c1b8f0847c736)

maskray/relr 2021-10-18 19:47:16 UTC
elf: Support DT_RELR relative relocation format [BZ #27924]

Author: Fangrui Song
Author Date: 2021-10-18 19:47:16 UTC

elf: Support DT_RELR relative relocation format [BZ #27924]

PIE and shared objects usually have many relative relocations. In
2017/2018, SHT_RELR/DT_RELR was proposed on
https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/GxjM0L-PBAAJ
("Proposal for a new section type SHT_RELR") and is a pre-standard. RELR
usually takes 3% or smaller space than R_*_RELATIVE relocations. The
virtual memory size of a mostly statically linked PIE is typically 5~10%
smaller.

---

Notes I will not include in the submitted commit:

Available on https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/maskray/relr

"pre-standard": even Solaris folks are happy with the refined generic-abi
proposal. Cary Coutant will apply the change
https://sourceware.org/pipermail/libc-alpha/2021-October/131781.html

This patch is simpler than Chrome OS's glibc patch and makes ELF_DYNAMIC_DO_RELR
available to all ports. I don't think the current glibc implementation
supports ia64 in an ELFCLASS32 container. That said, the style I used is
works with an ELFCLASS32 container for 64-bit machine if ElfW(Addr) is
64-bit.

* Chrome OS folks have carried a local patch since 2018 (latest version:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/main/sys-libs/glibc/files/local/glibc-2.32).
  I.e. this feature has been battle tested.
* Android bionic supports 2018 and switched to DT_RELR==36 in 2020.
* The Linux kernel has supported CONFIG_RELR since 2019-08
  (https://git.kernel.org/linus/5cf896fb6be3effd9aea455b22213e27be8bdb1d).
* A musl patch (by me) exists but is not applied:
  https://www.openwall.com/lists/musl/2019/03/06/3
* rtld-elf from FreeBSD 14 will support DT_RELR.

I believe upstream glibc should support DT_RELR to benefit all Linux
distributions. I filed some feature requests to get their attention:

* Gentoo: https://bugs.gentoo.org/818376
* Arch Linux: https://bugs.archlinux.org/task/72433
* Debian https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996598
* Fedora https://bugzilla.redhat.com/show_bug.cgi?id=2014699

As of linker support (to the best of my knowledge):

* LLD support DT_RELR.
* https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/main/sys-devel/binutils/files/
  has a gold patch.
* GNU ld feature request https://sourceware.org/bugzilla/show_bug.cgi?id=27923

I wish that GNU ld and gold maintainers can implement the feature as well :)

Tested on aarch64 and x86_64.

Changes from v1 (https://sourceware.org/pipermail/libc-alpha/2021-October/131768.html)
* Fix style, simplify code
* Improve test

azanella/ld-audit-fixes-v4 2021-10-13 19:26:05 UTC
elf: Add SVE support for aarch64 rtld-audit

Author: Adhemerval Zanella
Author Date: 2021-08-04 15:30:56 UTC

elf: Add SVE support for aarch64 rtld-audit

To implement lazy binding is enabled when profiling or auditing used,
even when STO_AARCH64_VARIANT_PCS is set. Also, to not incur in
performance penalties on architecture without SVE, the PLT entrypoint
is set to a newer one, _dl_runtime_profile_sve, which is used iff
'hwcap' has HWCAP_SVE bit set.

This should be a fair assumption since SVE has a defined set of
registers for argument passing and return values. A new ABI with either
different argument passing or different registers would require a
different PLT entry, but I assume this would require another symbol flag
anyway (or at least a different ELF mark to indicate so).

The profile '_dl_runtime_profile_sve' entrypoint assumes the largest SVE
register size possible (2048 bits) and thus it requires a quite large
stack (8976 bytes). I think it would be possible make the stack
requirement dynamic depending of the vector length, but it would make
the PLT audit function way more complex.

It extends the La_aarch64_vector with a long double pointer to a stack
alloced buffer to hold the SVE Z register, along with a pointer to hold
the P registers on La_aarch64_regs.

It means the if 'lr_sve' is 0 in either La_aarch64_regs or
La_aarch64_retval the La_aarch64_vector contains the floating-pointer
registers that can be accessed directly (non SVE hardware). Otherwise,
'La_aarch64_vector.z' points to a memory area that holds up to 'lr_sve'
bytes for the Z registers, which can be loaded with svld1 intrinsic for
instance (as tst-audit28.c does). The P register follows the same
logic, with each La_aarch64_regs.lr_sve_pregs pointing to an area of
memory 'lr_sve/8' in size.

So, to access the FP register as float you can use:

 static inline float regs_vec_to_float (const La_aarch64_regs *regs,
            int idx)
 {
   float r;
   if (regs->lr_sve == 0)
     r = regs->lr_vreg[idx].s;
   else
     memcpy (&r, &regs->lr_vreg[idx].z[0], sizeof (r));
   return r;
 }

This patch is not complete yet: the tst-audit28 does not check if
compiler supports SVE (we would need a configure check to disable for
such case), I need to add a proper comment for the
_dl_runtime_profile_sve stack layout, the test need to check for the P
register state clobbering.

I also haven't check the performance penalties with this approach, and
maybe the way I am saving/restoring the SVE register might be optimized.

In any case, I checked on a SVE machine and at least the testcase work
as expected without any regressions. I also did a sniff test on a non
SVE machine.

Checked on aarch64-linux-gnu with SVE support.

release/2.32/master 2021-10-13 12:57:56 UTC
elf: Replace nsid with args.nsid [BZ #27609]

Author: H.J. Lu
Author Date: 2021-09-30 17:29:17 UTC

elf: Replace nsid with args.nsid [BZ #27609]

commit ec935dea6332cb22f9881cd1162bad156173f4b0
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Apr 24 22:31:15 2020 +0200

    elf: Implement __libc_early_init

has

@@ -856,6 +876,11 @@ no more namespaces available for dlmopen()"));
   /* See if an error occurred during loading. */
   if (__glibc_unlikely (exception.errstring != NULL))
     {
+ /* Avoid keeping around a dangling reference to the libc.so link
+ map in case it has been cached in libc_map. */
+ if (!args.libc_already_loaded)
+ GL(dl_ns)[nsid].libc_map = NULL;
+

do_dlopen calls _dl_open with nsid == __LM_ID_CALLER (-2), which calls
dl_open_worker with args.nsid = nsid. dl_open_worker updates args.nsid
if it is __LM_ID_CALLER. After dl_open_worker returns, it is wrong to
use nsid.

Replace nsid with args.nsid after dl_open_worker returns. This fixes
BZ #27609.

(cherry picked from commit 1e1ecea62e899acb58c3fdf3b320a0833ddd0dff)

release/2.33/master 2021-10-13 12:29:59 UTC
elf: Replace nsid with args.nsid [BZ #27609]

Author: H.J. Lu
Author Date: 2021-09-30 17:29:17 UTC

elf: Replace nsid with args.nsid [BZ #27609]

commit ec935dea6332cb22f9881cd1162bad156173f4b0
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Apr 24 22:31:15 2020 +0200

    elf: Implement __libc_early_init

has

@@ -856,6 +876,11 @@ no more namespaces available for dlmopen()"));
   /* See if an error occurred during loading. */
   if (__glibc_unlikely (exception.errstring != NULL))
     {
+ /* Avoid keeping around a dangling reference to the libc.so link
+ map in case it has been cached in libc_map. */
+ if (!args.libc_already_loaded)
+ GL(dl_ns)[nsid].libc_map = NULL;
+

do_dlopen calls _dl_open with nsid == __LM_ID_CALLER (-2), which calls
dl_open_worker with args.nsid = nsid. dl_open_worker updates args.nsid
if it is __LM_ID_CALLER. After dl_open_worker returns, it is wrong to
use nsid.

Replace nsid with args.nsid after dl_open_worker returns. This fixes
BZ #27609.

(cherry picked from commit 1e1ecea62e899acb58c3fdf3b320a0833ddd0dff)

siddhesh/fortify3 2021-10-12 08:29:29 UTC
debug: Add tests for _FORTIFY_SOURCE=3

Author: Siddhesh Poyarekar
Author Date: 2021-10-12 05:26:43 UTC

debug: Add tests for _FORTIFY_SOURCE=3

Add some testing coverage for _FORTIFY_SOURCE=3.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

maskray/x86-mpx 2021-10-11 05:32:12 UTC
elf: Remove Intel MPX support (lazy PLT, ld.so profile, and LD_AUDIT)

Author: Fangrui Song
Author Date: 2021-10-11 05:32:12 UTC

elf: Remove Intel MPX support (lazy PLT, ld.so profile, and LD_AUDIT)

Intel MPX failed to gain wide adoption and has been deprecated for a
while. GCC 9.1 removed Intel MPX support. Linux kernel removed MPX in
2019.

This patch removes the support code from the dynamic loader.

azanella/dso-opt 2021-09-28 16:20:01 UTC
BZ #17645, fix slow DSO sorting behavior in dynamic loader -- Algorithm changes

Author: Chung-Lin Tang
Author Date: 2021-07-20 14:25:17 UTC

BZ #17645, fix slow DSO sorting behavior in dynamic loader -- Algorithm changes

This part is the actual code changes. While the past attempts appeared
to be either (1) more sophisticated graph algorithms, with attempts to
add Tarjan SCC, or (2) modifying of heuristics to augment the old
algorithm to behave more reasonably, here I have basically adhered to
the KISS principle.

The main algorithm here is simply depth-first search (DFS) to obtain the
Reverse-Post Order (RPO) sequence, a topological sort. A new
l_visited:1 bitfield is added to struct link_map to more elegantly
facilitate such a search.

I also have experimented with doing an iterative version, but it is
obviously harder to understand, and actually slower when measured by
hp-timing.h facilities. I have chosen to use simple recursive DFS, for
clarity and performance (Some measures were however taken to curb
recursion depth)

The DFS algorithm is applied to the input maps[nmap-1] backwards towards
maps[0]. This has the effect of a more "shallow" recursion depth in
general since the input is in BFS. Also, when combined with the natural
order of processing l_initfini[] at each node, this creates a resulting
output sorting closer to the intuitive "left-to-right" order in most
cases.

Per-the discussion in #15311 about relocation dependencies overriding
link dependencies, similar to comments #7,#9 there, a second pass of
link-dependency-only sorting has been added in that case. Detection of
existence of reldeps is done during the first DFS traversal pass, to
cull away unneeded cases of this 2nd sorting pass. This also allows
discarding of the simple limited cycle detection (i.e. X has reldep on Y,
Y links to X) in the current algorithm. A testcase expressing the
BZ#15311 case has also been added.

On the further general issue of circular dependencies causing SCCs
across shared objects, the ELF specification explicitly states that
behavior in this case is undefined, although I have found at least one
reference describing Solaris' behavior here as basically retaining the
received original ordering of those objects [1]. While quite well defined,
I'm a little unsure this is the reasonable behavior, as this seems to
imply a single circular dependency link will nullify correct topological
dependency behavior for the majority of nodes within that SCC.

The Tarjan SCC algorthm has been mentioned multiple times in these
related BZ issues. It could be said that the Tarjan algorithm is a
generalization of post-order DFS traversal; some might say that's an
understatement, but the phases of the node visiting and processing
really look analogous. It would be possible to extend and implement it
mostly within the confines of the code of my patch, but considering the
undefined status in the spec, arguably some ambiguities of proper
reasonable behavior, and the much more bookkeeping in a piece of code
that will be repeatedly executed an incredible number of times across
all systems, of which only applies to quite rare cases, I have refrained
from adding that kind of processing in this patch, though such issues
may be revisited later.

Other two notable implementation adjustments related to this
_dl_sort_maps() change are:

  (1) The additional pass of sorting in dl_open_worker() right before
      relocation has been removed. _dl_map_object_deps() already does
      a pass of sorting, and simply collecting objects by that order is
      adequate. Sorting again in that place before relocation appears
      to be redundant.

  (2) The use of two char arrays 'used' and 'done' in _dl_close_worker
      to represent two per-map attributes has been changed to simply use
      the two bits in the 'l_reserved' field in struct link_map to
      implement. This also allows discarding the clunky 'used' array
      sorting that _dl_sort_maps had to (sometimes) do along the way.

This patch has been tested on x86_64-linux, powerpc64le-linux,
aarch64-linux without regressions (includes the new tests I've added).

[1] https://docs.oracle.com/cd/E19957-01/806-0641/6j9vuquip/index.html
    (section "Initialization and Termination Routines")

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

azanella/rtld-shared 2021-09-27 16:58:32 UTC
elf: Add dlmopen / RTLD_SHARED tests

Author: Vivek Das Mohapatra
Author Date: 2021-08-03 13:24:47 UTC

elf: Add dlmopen / RTLD_SHARED tests

We ensure a DF_GNU_1_UNIQUE library is loaded (as a DT_NEEDED
dependency) into the target namespace by the test module.

This checks that the code path for dependencies honours the flag
and prepares a base namespace library with a proxy in the target
namespace (since the mechanism for this is not the same as for
DSOs that have already been loaded into the base namespace).

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

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

azanella/ld-audit-fixes 2021-09-10 18:07:38 UTC
elf: Add SVE support for aarch64 rtld-audit

Author: Adhemerval Zanella
Author Date: 2021-08-04 15:30:56 UTC

elf: Add SVE support for aarch64 rtld-audit

To implement lazy binding is enabled when profiling or auditing used,
even when STO_AARCH64_VARIANT_PCS is set. Also, to not incur in
performance penalties on architecture without SVE, the PLT entrypoint
is set to a newer one, _dl_runtime_profile_sve, which is used iff
'hwcap' has HWCAP_SVE bit set.

This should be a fair assumption since SVE has a defined set of
registers for argument passing and return values. A new ABI with either
different argument passing or different registers would require a
different PLT entry, but I assume this would require another symbol flag
anyway (or at least a different ELF mark to indicate so).

The profile '_dl_runtime_profile_sve' entrypoint assumes the largest SVE
register size possible (2048 bits) and thus it requires a quite large
stack (8976 bytes). I think it would be possible make the stack
requirement dynamic depending of the vector length, but it would make
the PLT audit function way more complex.

It extends the La_aarch64_vector with a long double pointer to a stack
alloced buffer to hold the SVE Z register, along with a pointer to hold
the P registers on La_aarch64_regs.

It means the if 'lr_sve' is 0 in either La_aarch64_regs or
La_aarch64_retval the La_aarch64_vector contains the floating-pointer
registers that can be accessed directly (non SVE hardware). Otherwise,
'La_aarch64_vector.z' points to a memory area that holds up to 'lr_sve'
bytes for the Z registers, which can be loaded with svld1 intrinsic for
instance (as tst-audit28.c does). The P register follows the same
logic, with each La_aarch64_regs.lr_sve_pregs pointing to an area of
memory 'lr_sve/8' in size.

So, to access the FP register as float you can use:

 static inline float regs_vec_to_float (const La_aarch64_regs *regs,
            int idx)
 {
   float r;
   if (regs->lr_sve == 0)
     r = regs->lr_vreg[idx].s;
   else
     memcpy (&r, &regs->lr_vreg[idx].z[0], sizeof (r));
   return r;
 }

This patch is not complete yet: the tst-audit28 does not check if
compiler supports SVE (we would need a configure check to disable for
such case), I need to add a proper comment for the
_dl_runtime_profile_sve stack layout, the test need to check for the P
register state clobbering.

I also haven't check the performance penalties with this approach, and
maybe the way I am saving/restoring the SVE register might be optimized.

In any case, I checked on a SVE machine and at least the testcase work
as expected without any regressions. I also did a sniff test on a non
SVE machine.

azanella/pthread-multiple-fixes 2021-09-10 14:36:28 UTC
nptl: Remove INVALID_TD_P

Author: Adhemerval Zanella
Author Date: 2021-08-23 19:02:30 UTC

nptl: Remove INVALID_TD_P

It is not used anymore.

azanella/qsort-fixes 2021-09-06 18:44:00 UTC
stdlib: Remove use of mergesort on qsort (BZ #21719)

Author: Adhemerval Zanella
Author Date: 2018-01-16 12:49:43 UTC

stdlib: Remove use of mergesort on qsort (BZ #21719)

This patch removes the mergesort optimization on qsort implementation
and uses the quicksort instead. The mergesort implementation has some
issues:

  - It is as-safe only for certain types sizes (if total size is less
    than 1 KB with large element sizes also forcing memory allocation)
    which contradicts the function documentation. Although not required
    by the C standard, it is preferable and doable to have an O(1) space
    implementation.

  - The malloc for certain element size and element number adds
    arbitrary latency (might even be worse if malloc is interposed).

  - To avoid trigger swap from memory allocation the implementation
    relies on system information that might be virtualized (for instance
    VMs with overcommit memory) which might lead to potentially use of
    swap even if system advertise more memory than actually has. The
    check also have the downside of issuing syscalls where none is
    expected (although only once per execution).

  - The mergesort is suboptimal on an already sorted array (BZ#21719).

The quicksort implementation is already optimized to use constant extra
space (due to the limit of total number of elements from maximum VM
size) and thus can be used to avoid the malloc usage issues.

Resulting performance is slower due the usage of qsort, specially in the
worst-case scenario (partialy or sorted arrays) and due the fact
mergesort uses a slight improved swap operations.

This change also renders the BZ#21719 fix unrequired (since it is meant
to fix the sorted input performance degradation for mergesort). The
manual is also updated to indicate the function is now async-cancel
safe.

Checked on x86_64-linux-gnu.

google/grte/v5-2.27/master 2021-08-31 22:36:41 UTC
Set the retain attribute on _elf_set_element if CC supports [BZ #27492]

Author: Fangrui Song
Author Date: 2021-04-16 18:26:39 UTC

Set the retain attribute on _elf_set_element if CC supports [BZ #27492]

So that text_set_element/data_set_element/bss_set_element defined
variables will be retained by the linker.

Note: 'used' and 'retain' are orthogonal: 'used' makes sure the variable
will not be optimized out; 'retain' prevents section garbage collection
if the linker support SHF_GNU_RETAIN.

GNU ld 2.37 and LLD 13 will support -z start-stop-gc which allow C
identifier name sections to be GCed even if there are live
__start_/__stop_ references.

Without the change, there are some static linking problems, e.g.
_IO_cleanup (libio/genops.c) may be discarded by ld --gc-sections, so
stdout is not flushed on exit.

Note: GCC may warning 'retain' attribute ignored while __has_attribute(retain)
is 1 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587).

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit cd6ae7ea5431c2b8f16201fb0e2c413bf8d2df06)

maskray/grte-old 2021-08-27 21:47:29 UTC
elf: Remove incorrect dynamic-link.h from _dl_relocate_static_pie

Author: Fangrui Song
Author Date: 2021-08-27 21:47:29 UTC

elf: Remove incorrect dynamic-link.h from _dl_relocate_static_pie

The header is included without STATIC_PIE_BOOTSTRAP.
This may introduce harmful GOT relocation on aarch64.

release/2.31/master 2021-08-18 20:45:27 UTC
x86_64: Remove unneeded static PIE check for undefined weak diagnostic

Author: Fangrui Song
Author Date: 2021-07-08 21:26:22 UTC

x86_64: Remove unneeded static PIE check for undefined weak diagnostic

https://sourceware.org/bugzilla/show_bug.cgi?id=21782 dropped an ld
diagnostic for R_X86_64_PC32 referencing an undefined weak symbol in
-pie links. Arguably keeping the diagnostic like other ports is more
correct, since statically resolving movl foo(%rip), %eax to the
link-time zero address produces a corrupted output.

It turns out that --enable-static-pie builds do not depend on the ld
behavior. GCC generates GOT indirection for weak declarations for
-fPIE/-fPIC, so what ld does with the PC-relative relocation doesn't
really matter.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 115d242456de158e698ffb0f9a5fee3118e9e825)

codonell/c-utf8 2021-07-29 05:31:39 UTC
Add generic C.UTF-8 locale (Bug 17318)

Author: Carlos-0
Author Date: 2021-07-29 05:27:56 UTC

Add generic C.UTF-8 locale (Bug 17318)

We add a new C.UTF-8 locale. This locale is not builtin to glibc, but
is provided as a distinct locale. The locale provides full support
for UTF-8 and this includes full code point sorting via strcmp-based
collation.

The collation uses a new keyword 'strcmp_collation' which drops all
collation rules and generates an empty zero rules collation to enable
strcmp usage in collation. This ensures that we get full code point
sorting for C.UTF-8 with a minimal 92 bytes of overhead (LC_COLLATE
structure information).

The new locale is added to SUPPORTED. Minimal test data for specific
code points (minus those not supported by collate-test) is provided
in C.UTF-8.in, and this verifies code point sorting is working
reasonably across the range. The locale was tested manually with the
full set of code points without failure.

The locale is harmonized with locales already shipping in Gentoo,
Debian, Ubuntu, Fedora, CentOS Stream, and RHEL. A new tst-iconv9 test
is added which verifies the C.UTF-8 locale is generally usable.

Testing for fnmatch, regexec, and recomp is provided by extending
bug-regex1, bugregex19, bug-regex4, bug-regex6, transbug, tst-fnmatch,
tst-regcomp-truncated, and tst-regex to use C.UTF-8.

Tested on x86_64 or i686 without regression.

release/2.27/master 2021-07-06 19:04:26 UTC
wordexp: handle overflow in positional parameter number (bug 28011)

Author: Andreas Schwab
Author Date: 2021-06-25 13:02:47 UTC

wordexp: handle overflow in positional parameter number (bug 28011)

Use strtoul instead of atoi so that overflow can be detected.

(cherry picked from commit 5adda61f62b77384718b4c0d8336ade8f2b4b35c)

arm/morello/master 2021-06-28 14:41:58 UTC
nptl: Add glibc.pthread.stack_cache_size tunable

Author: Florian Weimer
Author Date: 2021-06-28 13:48:58 UTC

nptl: Add glibc.pthread.stack_cache_size tunable

The valgrind/helgrind test suite needs a way to make stack dealloction
more prompt, and this feature seems to be generally useful.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

fw/librt 2021-06-03 20:07:54 UTC
Linux: Cleanups after librt move

Author: Florian Weimer
Author Date: 2021-06-03 19:01:27 UTC

Linux: Cleanups after librt move

librt.so is no longer installed for PTHREAD_IN_LIBC, and tests
are not linked against it.

GLIBC_PRIVATE symbols that were needed during the transition are
removed again.

ibm/2.32/master 2021-04-27 12:45:59 UTC
Merge branch release/2.32/master into ibm/2.32/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2021-04-27 12:45:59 UTC

Merge branch release/2.32/master into ibm/2.32/master

release/2.28/master 2021-04-14 06:19:58 UTC
Fix SXID_ERASE behavior in setuid programs (BZ #27471)

Author: Siddhesh Poyarekar
Author Date: 2021-03-16 07:07:55 UTC

Fix SXID_ERASE behavior in setuid programs (BZ #27471)

When parse_tunables tries to erase a tunable marked as SXID_ERASE for
setuid programs, it ends up setting the envvar string iterator
incorrectly, because of which it may parse the next tunable
incorrectly. Given that currently the implementation allows malformed
and unrecognized tunables pass through, it may even allow SXID_ERASE
tunables to go through.

This change revamps the SXID_ERASE implementation so that:

- Only valid tunables are written back to the tunestr string, because
  of which children of SXID programs will only inherit a clean list of
  identified tunables that are not SXID_ERASE.

- Unrecognized tunables get scrubbed off from the environment and
  subsequently from the child environment.

- This has the side-effect that a tunable that is not identified by
  the setxid binary, will not be passed on to a non-setxid child even
  if the child could have identified that tunable. This may break
  applications that expect this behaviour but expecting such tunables
  to cross the SXID boundary is wrong.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>

(cherry picked from commit 2ed18c5b534d9e92fc006202a5af0df6b72e7aca)

release/2.29/master 2021-04-14 05:38:02 UTC
Fix SXID_ERASE behavior in setuid programs (BZ #27471)

Author: Siddhesh Poyarekar
Author Date: 2021-03-16 07:07:55 UTC

Fix SXID_ERASE behavior in setuid programs (BZ #27471)

When parse_tunables tries to erase a tunable marked as SXID_ERASE for
setuid programs, it ends up setting the envvar string iterator
incorrectly, because of which it may parse the next tunable
incorrectly. Given that currently the implementation allows malformed
and unrecognized tunables pass through, it may even allow SXID_ERASE
tunables to go through.

This change revamps the SXID_ERASE implementation so that:

- Only valid tunables are written back to the tunestr string, because
  of which children of SXID programs will only inherit a clean list of
  identified tunables that are not SXID_ERASE.

- Unrecognized tunables get scrubbed off from the environment and
  subsequently from the child environment.

- This has the side-effect that a tunable that is not identified by
  the setxid binary, will not be passed on to a non-setxid child even
  if the child could have identified that tunable. This may break
  applications that expect this behaviour but expecting such tunables
  to cross the SXID boundary is wrong.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>

(cherry picked from commit 2ed18c5b534d9e92fc006202a5af0df6b72e7aca)

release/2.30/master 2021-04-14 05:28:20 UTC
Fix SXID_ERASE behavior in setuid programs (BZ #27471)

Author: Siddhesh Poyarekar
Author Date: 2021-03-16 07:07:55 UTC

Fix SXID_ERASE behavior in setuid programs (BZ #27471)

When parse_tunables tries to erase a tunable marked as SXID_ERASE for
setuid programs, it ends up setting the envvar string iterator
incorrectly, because of which it may parse the next tunable
incorrectly. Given that currently the implementation allows malformed
and unrecognized tunables pass through, it may even allow SXID_ERASE
tunables to go through.

This change revamps the SXID_ERASE implementation so that:

- Only valid tunables are written back to the tunestr string, because
  of which children of SXID programs will only inherit a clean list of
  identified tunables that are not SXID_ERASE.

- Unrecognized tunables get scrubbed off from the environment and
  subsequently from the child environment.

- This has the side-effect that a tunable that is not identified by
  the setxid binary, will not be passed on to a non-setxid child even
  if the child could have identified that tunable. This may break
  applications that expect this behaviour but expecting such tunables
  to cross the SXID boundary is wrong.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>

(cherry picked from commit 2ed18c5b534d9e92fc006202a5af0df6b72e7aca)

nsz/bug19329-v2 2021-04-13 07:43:40 UTC
RFC elf: Fix slow tls access after dlopen [BZ #19924]

Author: Szabolcs Nagy
Author Date: 2021-02-16 12:55:13 UTC

RFC elf: Fix slow tls access after dlopen [BZ #19924]

In short: __tls_get_addr checks the global generation counter,
_dl_update_slotinfo updates up to the generation of the accessed
module. If the global generation is newer than geneneration of the
module then __tls_get_addr keeps hitting the slow path that updates
the dtv.

Possible approaches i can see:

1. update to global generation instead of module,
2. check the module generation in the fast path.

This patch is 1.: it needs additional sync (load acquire) so the
slotinfo list is up to date with the observed global generation.

Approach 2. would require walking the slotinfo list at all times.
I don't know how to make that fast with many modules.

Note: in the x86_64 version of dl-tls.c the generation is only loaded
once, since relaxed mo is not faster than acquire mo load.

I have not benchmarked this yet.

nsz/mtag-2 2021-03-19 11:49:13 UTC
malloc: Ensure mtag code path in checked_request2size is cold

Author: Szabolcs Nagy
Author Date: 2021-03-15 11:44:32 UTC

malloc: Ensure mtag code path in checked_request2size is cold

This is a workaround (hack) for a gcc optimization issue (PR 99551).
Without this the generated code may evaluate the expression in the
cold path which causes performance regression for small allocations
in the memory tagging disabled (common) case.

nsz/mtag 2021-03-19 11:46:21 UTC
aarch64: Optimize __libc_mtag_tag_zero_region

Author: Szabolcs Nagy
Author Date: 2021-02-09 17:59:11 UTC

aarch64: Optimize __libc_mtag_tag_zero_region

This is a target hook for memory tagging, the original was a naive
implementation. Uses the same algorithm as __libc_mtag_tag_region,
but with instructions that also zero the memory. This was not
benchmarked on real cpu, but expected to be faster than the naive
implementation.

ibm/2.30/master 2021-03-18 21:08:42 UTC
NEWS: Fix typo in CVE-2021-3326 entry

Author: Florian Weimer
Author Date: 2021-01-29 17:20:54 UTC

NEWS: Fix typo in CVE-2021-3326 entry

schwab/ilp32-2.33 2021-03-07 14:42:45 UTC
aarch64: Update ILP32 abilists for glibc 2.33

Author: Andreas Schwab
Author Date: 2021-02-21 21:22:29 UTC

aarch64: Update ILP32 abilists for glibc 2.33

schwab/ilp32 2021-03-07 14:42:45 UTC
aarch64: Update ILP32 abilists for glibc 2.33

Author: Andreas Schwab
Author Date: 2021-02-21 21:22:29 UTC

aarch64: Update ILP32 abilists for glibc 2.33

tuliom/microwatt 2021-02-17 16:38:29 UTC
powerpc64: Stop assuming new processors have VSX

Author: Tulio Magno Quites Machado Filho
Author Date: 2020-10-02 13:18:48 UTC

powerpc64: Stop assuming new processors have VSX

VSX has been available on IBM POWER since POWER7. All IBM processors
compliant with POWER ISAs 2.07, 3.0 and 3.1 also support VSX.
This patch aims to remove a barrier for new processors as they start to
support Linux on powerpc64 while not having support for all the altivec
and vsx instructions.

nsz/bug19329 2021-02-15 12:05:21 UTC
elf: Remove lazy tlsdesc relocation related code

Author: Szabolcs Nagy
Author Date: 2021-02-11 13:24:47 UTC

elf: Remove lazy tlsdesc relocation related code

Remove generic tlsdesc code related to lazy tlsdesc processing since
lazy tlsdesc relocation is no longer supported. This includes removing
GL(dl_load_lock) from _dl_make_tlsdesc_dynamic which is only called at
load time when that lock is already held.

Added a documentation comment too.

ibm/2.28/master 2021-02-13 21:49:56 UTC
Merge branch release/2.28/master into ibm/2.28/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2021-02-13 21:49:56 UTC

Merge branch release/2.28/master into ibm/2.28/master

nsz/bug27072 2021-01-20 14:42:46 UTC
Make libc symbols hidden in static PIE

Author: Szabolcs Nagy
Author Date: 2021-01-06 11:31:04 UTC

Make libc symbols hidden in static PIE

Hidden visibility can avoid indirections and RELATIVE relocs in
static PIE libc.

The check should use IS_IN_LIB instead of IS_IN(libc) since all
symbols are defined locally in static PIE and the optimization is
useful in all libraries not just libc. However the test system
links objects from libcrypt.a into dynamic linked test binaries
where hidden visibility does not work. I think mixing static and
shared libc components in the same binary should not be supported
usage, but to be safe only use hidden in libc.a.

On some targets (i386) this optimization cannot be applied because
hidden visibility PIE ifunc functions don't work, so it is gated by
NO_HIDDEN_EXTERN_FUNC_IN_PIE.

From -static-pie linked 'int main(){}' this shaves off 71 relative
relocs on aarch64 and reduces code size by about 2k.

maskray/stack_chk_guard 2021-01-12 07:56:32 UTC
Unconditionally define __stack_chk_guard [BZ #26817]

Author: Fangrui Song
Author Date: 2021-01-12 07:56:32 UTC

Unconditionally define __stack_chk_guard [BZ #26817]

__stack_chk_guard is currently unavailable on architectures which define
THREAD_SET_STACK_GUARD, so {gcc,clang} -fstack-protector
-mstack-protector-guard=global will fail to link due to the undefined
symbol.

Define __stack_chk_guard to make -mstack-protector-guard=global compiled
user programs work. `#define THREAD_SET_STACK_GUARD` code is moved
outside of `#ifndef __ASSEMBLER__` so that cpp can preprocess
elf/Versions.

rearnsha/mte-v4.0 2020-12-18 19:23:04 UTC
aarch64: Add aarch64-specific files for memory tagging support

Author: Richard Earnshaw
Author Date: 2020-12-18 19:00:49 UTC

aarch64: Add aarch64-specific files for memory tagging support

This final patch provides the architecture-specific implementation of
the memory-tagging support hooks for aarch64.

fw/glibc-hwcaps 2020-12-07 08:13:08 UTC
s390x: Add Add glibc-hwcaps support

Author: Florian Weimer
Author Date: 2020-12-07 08:12:05 UTC

s390x: Add Add glibc-hwcaps support

Subdirectories z13, z14, z15 can be selected, mostly based on the
level of support for vector instructions.

nsz/btifix-v3 2020-12-02 08:48:08 UTC
aarch64: Use mmap to add PROT_BTI instead of mprotect [BZ #26831]

Author: Szabolcs Nagy
Author Date: 2020-12-01 10:13:18 UTC

aarch64: Use mmap to add PROT_BTI instead of mprotect [BZ #26831]

Re-mmap executable segments if possible instead of using mprotect
to add PROT_BTI. This allows using BTI protection with security
policies that prevent mprotect with PROT_EXEC.

If the fd of the ELF module is not available because it was kernel
mapped then mprotect is used and failures are ignored. To protect
the main executable even when mprotect is filtered the linux kernel
 will have to be changed to add PROT_BTI to it.

The delayed failure reporting is mainly needed because currently
_dl_process_gnu_properties does not propagate failures such that
the required cleanups happen. Using the link_map_machine struct for
error propagation is not ideal, but this seemed to be the least
intrusive solution.

Fixes bug 26831.

nsz/bti-1 2020-11-25 15:25:28 UTC
aarch64: Use mmap to add PROT_BTI instead of mprotect [BZ #26831]

Author: Szabolcs Nagy
Author Date: 2020-10-28 18:10:23 UTC

aarch64: Use mmap to add PROT_BTI instead of mprotect [BZ #26831]

Re-mmap executable segments if possible instead of using mprotect
to add PROT_BTI. This allows using BTI protection with security
policies that prevent mprotect with PROT_EXEC.

If the fd of the ELF module is not available because it was kernel
mapped then mprotect is used and failures are ignored. To protect
the main executable even when mprotect is filtered the linux kernel
will have to be changed to add PROT_BTI to it.

Computing the mapping bounds follows _dl_map_object_from_fd more
closely now.

The delayed failure reporting is mainly needed because currently
_dl_process_gnu_properties does not propagate failures such that
the required cleanups happen. Using the link_map_machine struct for
error propagation is not ideal, but this seemed to be the least
intrusive solution.

Fixes bug 26831.

rearnsha/mte-v3.0 2020-11-20 18:13:52 UTC
aarch64: Add aarch64-specific files for memory tagging support

Author: Richard Earnshaw
Author Date: 2020-11-20 17:20:10 UTC

aarch64: Add aarch64-specific files for memory tagging support

This final patch provides the architecture-specific implementation of
the memory-tagging support hooks for aarch64.

release/2.26/master 2020-11-04 12:30:42 UTC
aarch64: Fix DT_AARCH64_VARIANT_PCS handling [BZ #26798]

Author: Szabolcs Nagy
Author Date: 2020-10-22 16:55:01 UTC

aarch64: Fix DT_AARCH64_VARIANT_PCS handling [BZ #26798]

The variant PCS support was ineffective because in the common case
linkmap->l_mach.plt == 0 but then the symbol table flags were ignored
and normal lazy binding was used instead of resolving the relocs early.
(This was a misunderstanding about how GOT[1] is setup by the linker.)

In practice this mainly affects SVE calls when the vector length is
more than 128 bits, then the top bits of the argument registers get
clobbered during lazy binding.

Fixes bug 26798.

(cherry picked from commit 558251bd8785760ad40fcbfeaaee5d27fa5b0fe4)

sasha/execveat 2020-09-07 15:36:23 UTC
Linux: Add execveat system call wrapper

Author: Alexandra Hájková
Author Date: 2020-04-27 14:52:38 UTC

 Linux: Add execveat system call wrapper

nsz/pacbti-v7 2020-07-08 12:05:39 UTC
aarch64: add NEWS entry about branch protection support

Author: Szabolcs Nagy
Author Date: 2020-06-11 17:19:40 UTC

aarch64: add NEWS entry about branch protection support

This is a new security feature that relies on architecture
extensions and needs glibc to be built with a gcc configured
with branch protection.

nsz/pacbti-v6 2020-07-02 08:27:05 UTC
aarch64: add NEWS entry about branch protection support

Author: Szabolcs Nagy
Author Date: 2020-06-11 17:19:40 UTC

aarch64: add NEWS entry about branch protection support

This is a new security feature that relies on architecture
extensions and needs glibc to be built with a gcc configured
with branch protection.

nsz/pacbti-v5 2020-06-22 14:21:14 UTC
aarch64: add NEWS entry about branch protection support

Author: Szabolcs Nagy
Author Date: 2020-06-11 17:19:40 UTC

aarch64: add NEWS entry about branch protection support

This is a new security feature that relies on architecture
extensions and needs glibc to be built with a gcc configured
with branch protection.

nsz/pacbti-v4 2020-06-12 13:34:39 UTC
aarch64: add NEWS entry about branch protection support

Author: Szabolcs Nagy
Author Date: 2020-06-11 17:19:40 UTC

aarch64: add NEWS entry about branch protection support

This is a new security feature that relies on architecture
extensions and needs glibc to be built with a gcc configured
with branch protection.

alistair/rv32.next 2020-04-26 02:16:16 UTC
Revert "Add IPPROTO_ETHERNET and IPPROTO_MPTCP from Linux 5.6 to netinet/in.h."

Author: Alistair Francis
Author Date: 2020-04-08 21:43:47 UTC

Revert "Add IPPROTO_ETHERNET and IPPROTO_MPTCP from Linux 5.6 to netinet/in.h."

This reverts commit f9ac84f92f151e07586c55e14ed628d493a5929d.

azanella/bz12683 2020-04-07 14:02:55 UTC
Linux: Remove sysdep-cancel header

Author: Adhemerval Zanella
Author Date: 2019-08-14 12:57:37 UTC

Linux: Remove sysdep-cancel header

Now that single-thread optimization is provided by single-thread.h
header and the enable/disable asynchronous cancellation functions are
no longer used on cancellable syscalls, the header can be removed.

Checked with a build for all major Linux architectures and for hurd.

ibm/2.26/master 2020-03-20 21:24:51 UTC
Merge branch release/2.26/master into ibm/2.26/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2020-03-20 21:24:51 UTC

Merge branch release/2.26/master into ibm/2.26/master

tuliom/libmvec 2020-02-19 20:29:34 UTC
PPC64: Attach SIMD attribute to cosf, sin, sinf function declarations.

Author: Bert Tenjy
Author Date: 2020-02-13 17:55:31 UTC

PPC64: Attach SIMD attribute to cosf, sin, sinf function declarations.

These changes were mistakenly left out of the patches that added SIMD
versions of these functions to libmvec.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>

fw/nss-reload 2020-02-19 19:55:48 UTC
nss: Introduce <nss_module.h>

Author: Florian Weimer
Author Date: 2020-02-19 19:55:48 UTC

nss: Introduce <nss_module.h>

This provides the struct nss_module type, which combines the old
struct service_library type with the known_function tree, by
statically allocating space for all function pointers.

struct nss_module is fairly large (536 bytes), but it will be
shared across NSS databases. The old known_function handling
had non-some per-function overhead (at least 32 bytes per looked-up
function, but more for long function anmes), so overall, this is not
too bad. Resolving all functions at load time simplifies locking,
and the repeated lookups should be fast because the caches are hot
at this point.

fw/bug25486 2020-02-15 19:43:34 UTC
elf: Rework exception handling in the dynamic loader [BZ #25486]

Author: Florian Weimer
Author Date: 2020-02-15 13:07:49 UTC

elf: Rework exception handling in the dynamic loader [BZ #25486]

The old exception handling implementation used function interposition
to replace the dynamic loader implementation (no TLS support) with the
libc implementation (TLS support). This results in problems if the
link order between the dynamic loader and libc is reversed (bug 25486).

The new implementation moves the entire implementation of the
exception handling functions back into the dynamic loader, using
THREAD_GETMEM and THREAD_SETMEM for thread-local data support.
These depends on Hurd support for these macros, added in commit
b65a82e4e757c1e6cb7073916 ("hurd: Add THREAD_GET/SETMEM/_NC").

One small obstacle is that the exception handling facilities are used
before the TCB has been set up, so a check is needed if the TCB is
available. If not, a regular global variable is used to store the
exception handling information.

Also rename dl-error.c to dl-catch.c, to avoid confusion with the
dlerror function.

fw/tst-lchmod 2020-02-12 19:58:56 UTC
Linux: Work around kernel bugs in chmod on /proc/self/fd paths

Author: Florian Weimer
Author Date: 2020-02-12 12:40:26 UTC

Linux: Work around kernel bugs in chmod on /proc/self/fd paths

It appears that the ability to change symbolic link modes through such
paths is unintended. On several file systems, the operation fails with
EOPNOTSUPP, even though the symbolic link permissions are updated.
The expected behavior is a failure to update the permissions, without
file system changes.

fw/nss-declare 2020-02-12 14:36:03 UTC
nss_nisplus: Use NSS_DECLARE_MODULE_FUNCTIONS

Author: Florian Weimer
Author Date: 2020-02-12 14:36:03 UTC

nss_nisplus: Use NSS_DECLARE_MODULE_FUNCTIONS

fw/syscall-cleanups 2020-02-09 16:39:40 UTC
microblaze: vfork syscall number is always available

Author: Florian Weimer
Author Date: 2020-02-09 16:07:07 UTC

microblaze: vfork syscall number is always available

Due to the built-in tables, __NR_vfork is always defined, so the
fork-based fallback code is never used.

(It appears that the vfork system call was wired up when the port was
contributed to the kernel.)

alistair/rv32.wip 2020-01-17 05:49:34 UTC
WIP

Author: Alistair Francis
Author Date: 2020-01-17 05:49:34 UTC

WIP

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

zack/no-nested-includes 2020-01-08 19:17:46 UTC
Rename sys/ucontext.h to bits/ucontext.h.

Author: Zack Weinberg
Author Date: 2019-06-11 17:05:02 UTC

Rename sys/ucontext.h to bits/ucontext.h.

sys/ucontext.h is effectively a bits header. Its contents are
extremely system-specific, and it’s strongly associated with a
specific public header (ucontext.h) that provides a superset of its
definitions, but there are other public headers that also require some
of its definitions. This patch therefore moves it into the bits/
namespace and adjusts all the headers that refer to it. In case there
are external users, a stub is added that includes ucontext.h.

Most of the fallout changes are trivial, but aarch64, ia64 and riscv
need a little more work. aarch64 sys/ucontext.h (now bits/ucontext.h)
was including sys/procfs.h for the definition of elf_greg_t etc;
the simplest fix is to have it include bits/procfs.h instead (and then
that needs to include sys/user.h for user_regs_struct). This is not
ideal but fixing it properly would require disentangling all of the
debugger interface headers which is more than I’m up for at the moment.

ia64 bits/ptrace.h and bits/procfs.h were both including
bits/sigcontext.h, which is only licensed to be included from
signal.h. (I’m not sure how this ever worked, or why it broke with
this patch and not some previous one.) This is fixed by creating
another single-type header, bits/types/__ia64_fpreg.h, which provides
the only thing they need from bits/sigcontext.h.

s/u/s/l/riscv/makecontext.c was defining makecontext with a function
head that didn’t agree with its official prototype (in ucontext.h);
formerly that file did not include ucontext.h, only sys/ucontext.h,
so we were getting away with it, but it’s still wrong. Making the
function head match the prototype actually simplifies the code.

 * sysdeps/generic/sys/ucontext.h: Move to top level bits/ucontext.h.
 Adjust multiple inclusion guard.
 * sysdeps/arm/sys/ucontext.h: Move to sysdeps/arm/bits/ucontext.h.
 Adjust multiple inclusion guard.
 * sysdeps/i386/sys/ucontext.h: Similarly.
 * sysdeps/m68k/sys/ucontext.h: Similarly.
 * sysdeps/mips/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/csky/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/riscv/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Similarly.
 * sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Similarly.
 * stdlib/Makefile: Install bits/ucontext.h.

 * stdlib/sys/ucontext.h: New backward compatibility stub header,
 includes ucontext.h.
 * include/sys/ucontext.h: New wrapper.

 * sysdeps/unix/sysv/linux/aarch64/bits/procfs.h: Allow inclusion
 by bits/ucontext.h as well as sys/procfs.h. Include sys/user.h.
 * sysdeps/unix/sysv/linux/aarch64/bits/ucontext.h: Include
 bits/procfs.h instead of sys/procfs.h.

 * sysdeps/unix/sysv/linux/ia64/bits/types/__ia64_fpreg.h:
 New file, contents factored out of ia64/bits/sigcontext.h and
 ia64/bits/ucontext.h.
 * sysdeps/unix/sysv/linux/ia64/Makefile:
 Install bits/types/__ia64_fpreg.h. Merge subdir=misc blocks.
 * sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
 * sysdeps/unix/sysv/linux/ia64/bits/ucontext.h:
 Include bits/types/__ia64_fpreg.h for struct ia64_fpreg.

 * sysdeps/unix/sysv/linux/ia64/bits/procfs.h:
 Include bits/types/__ia64_fpreg.h for struct ia64_fpreg.
 Don’t include bits/sigcontext.h or bits/ucontext.h.
 * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h:
 Don’t include bits/sigcontext.h.

 * sysdeps/unix/sysv/linux/riscv/makecontext.c: Include
 ucontext.h, not sys/ucontext.h. Correct function head to match
 prototype in ucontext.h. Use va_arg to retrieve all arguments
 past argc.

 * sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c:
 Sort list of includes.

 * signal/signal.h, stdlib/ucontext.h
 * sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
 * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
 * sysdeps/unix/sysv/linux/riscv/bits/procfs.h
 * sysdeps/unix/sysv/linux/s390/bits/procfs.h:
 Include bits/ucontext.h, not sys/ucontext.h.

 * sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h
 * sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
 * sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h
 * sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h:
 Include signal.h, not sys/ucontext.h.

 * sysdeps/unix/sysv/linux/arm/register-dump.h
 * sysdeps/unix/sysv/linux/csky/register-dump.h:
 Include ucontext.h, not sys/ucontext.h.

 * sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
 * sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym
 * sysdeps/unix/sysv/linux/arm/ucontext_i.sym
 * sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym
 * sysdeps/unix/sysv/linux/hppa/ucontext_i.sym
 * sysdeps/unix/sysv/linux/i386/ucontext_i.sym
 * sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym
 * sysdeps/unix/sysv/linux/m68k/m680x0/ucontext_i.sym
 * sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym
 * sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym
 * sysdeps/unix/sysv/linux/mips/ucontext_i.sym
 * sysdeps/unix/sysv/linux/nios2/ucontext_i.sym
 * sysdeps/unix/sysv/linux/riscv/ucontext_i.sym
 * sysdeps/unix/sysv/linux/s390/ucontext_i.sym
 * sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
 * sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
 * sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym
 * sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym:
 Include stddef.h and signal.h; don’t include any other headers.

 * scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES)
 (SYSDEP_ALLOWED_INCLUDES): Update.

zack/obsolete-time-functions 2020-01-06 20:39:28 UTC
Warn when gettimeofday is called with non-null tzp argument.

Author: Zack Weinberg
Author Date: 2019-08-19 17:51:25 UTC

Warn when gettimeofday is called with non-null tzp argument.

Since there are no known uses of gettimeofday's vestigial "get time
zone" feature that are not bugs, add a fortify-style wrapper inline to
sys/time.h that issues a warning whenever gettimeofday is called with
a second argument that is not a compile-time null pointer
constant.

At present this is only possible with GCC; clang does not implement
attribute((warning)). The wrapper is only activated when __OPTIMIZE__
is defined because it throws false positives when optimization is off,
even though it's an always-inline function.

An oversight in the implementation of __builtin_constant_p causes it
to fail to detect compile-time *pointer* constants unless they are
cast to an integer of a different size. (Loss of data in this cast is
harmless; the overall expression is still constant if and only if the
original pointer was.) This is GCC bug 95514. Thanks to
Kamil Cukrowski <kamilcukrowski@gmail.com> for the workaround.
As a precaution, I added a static assertion to debug/warning-nop.c to
make sure that the cast _is_ casting to an integer of a different
size; this is too unlikely a scenario to be worth checking in the
public header, but if someone ever adds a port where short is the
same size as intptr_t, we'll still catch it.

gabriel/powerpc-ieee128-printscan 2019-12-13 22:06:02 UTC
RFC: powerpc64le: Enable support for IEEE long double

Author: Gabriel F. T. Gomes
Author Date: 2019-07-11 14:48:28 UTC

RFC: powerpc64le: Enable support for IEEE long double

Not for glibc-2.31 - Do not commit!

No changes since v3.

Changes since v2:

  - Added definition of LDBL_IBM128_COMPAT_VERSION and
    LDBL_IBM128_VERSION (moved from a previous commit).

Changes since v1:

  - Use __LONG_DOUBLE_USES_FLOAT128 directly.

-- 8< --
On platforms where long double may have two different formats, i.e.: the
same format as double (64-bits) or something else (128-bits), building
with -mlong-double-128 is the default and function calls in the user
program match the name of the function in Glibc. When building with
-mlong-double-64, Glibc installed headers redirect such calls to the
appropriate function.

This patch adds similar redirections to be used by user code builds in
IEEE long double mode (-mabi=ieeelongdouble). It also skips some uses
of libc_hidden_proto in internal headers, because they also produce
redirections, causing a redirection conflict.

PS: Missing NEWS entry.

vineet/arc-glibc-2.30-time_t-32-bit 2019-12-09 23:23:35 UTC
build-many-glibcs.py: Enable ARC hard float builds

Author: Vineet Gupta
Author Date: 2019-11-07 23:24:05 UTC

build-many-glibcs.py: Enable ARC hard float builds

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

fw/dlopen-nodelete-reloc 2019-12-03 08:27:57 UTC
WIP dlopen NODELETE test

Author: Florian Weimer
Author Date: 2019-12-03 08:26:03 UTC

WIP dlopen NODELETE test

fw/bug24214 2019-11-29 15:37:58 UTC
elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]

Author: Florian Weimer
Author Date: 2019-11-29 15:37:58 UTC

elf: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]

This commit adds missing skip_ifunc checks to aarch64, arm, i386,
sparc, and x86_64. A new test case ensures that IRELATIVE IFUNC
resolvers do not run in various diagnostic modes of the dynamic
loader.

Tested on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,
s390-linux-gnu, s390x-linux-gnu, powerpc64le-linux-gnu. Built with
build-many-glibcs.py.

release/2.24/master 2019-11-28 15:22:07 UTC
libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]

Author: Florian Weimer
Author Date: 2019-11-22 21:10:42 UTC

libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]

Commit c402355dfa7807b8e0adb27c009135a7e2b9f1b0 ("libio: Disable
vtable validation in case of interposition [BZ #23313]") only covered
the interposable glibc 2.1 handles, in libio/stdfiles.c. The
parallel code in libio/oldstdfiles.c needs similar detection logic.

Fixes (again) commit db3476aff19b75c4fdefbe65fcd5f0a90588ba51
("libio: Implement vtable verification [BZ #20191]").

Change-Id: Ief6f9f17e91d1f7263421c56a7dc018f4f595c21
(cherry picked from commit cb61630ed712d033f54295f776967532d3f4b46a)

release/2.25/master 2019-11-28 15:21:26 UTC
libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]

Author: Florian Weimer
Author Date: 2019-11-22 21:10:42 UTC

libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]

Commit c402355dfa7807b8e0adb27c009135a7e2b9f1b0 ("libio: Disable
vtable validation in case of interposition [BZ #23313]") only covered
the interposable glibc 2.1 handles, in libio/stdfiles.c. The
parallel code in libio/oldstdfiles.c needs similar detection logic.

Fixes (again) commit db3476aff19b75c4fdefbe65fcd5f0a90588ba51
("libio: Implement vtable verification [BZ #20191]").

Change-Id: Ief6f9f17e91d1f7263421c56a7dc018f4f595c21
(cherry picked from commit cb61630ed712d033f54295f776967532d3f4b46a)

fw/libc-early-init-2 2019-11-28 13:28:44 UTC
Implement __libc_early_init

Author: Florian Weimer
Author Date: 2019-10-11 14:11:21 UTC

Implement __libc_early_init

This function is defined in libc.so, and the dynamic loader calls
right after relocation has been finished, before any ELF constructors
or the preinit function is invoked. It is also used in the static
build for initializing parts of the static libc.

To locate __libc_early_init, a direct symbol lookup function is used,
_dl_lookup_direct. It does not search the entire symbol scope and
consults merely a single link map. This function could also be used
to implement lookups in the vDSO (as an optimization).

A per-namespace variable (libc_map) is added for locating libc.so,
to avoid repeated traversals of the search scope. It is similar to
GL(dl_initfirst). An alternative would have been to thread a context
argument from _dl_open down to _dl_map_object_from_fd (where libc.so
is identified). This could have avoided the global variable, but
the change would be larger as a result. It would not have been
possible to use this to replace GL(dl_initfirst) because that global
variable is used to pass the function pointer past the stack switch
from dl_main to the main program. Replacing that requires adding
a new argument to _dl_init, which in turn needs changes to the
architecture-specific libc.so startup code written in assembler.

__libc_early_init should not be used to replace _dl_var_init (as
it exists today on some architectures). Instead, _dl_lookup_direct
should be used to look up a new variable symbol in libc.so, and
that should then be initialized from the dynamic loader, immediately
after the object has been loaded in _dl_map_object_from_fd (before
relocation is run). This way, more IFUNC resolvers which depend on
these variables will work.

fw/no-symlinks 2019-11-28 12:40:01 UTC
Add --disable-major-minor-libraries configure option

Author: Florian Weimer
Author Date: 2019-11-28 11:57:25 UTC

Add --disable-major-minor-libraries configure option

This option can be used to increase compatibility with package managers.
The name was choosen to avoid confusion with all the different versions
(glibc release, soname versions, symbol versions).

This patch makes all uses of -$(version).so conditional on the new
$(major-minor-libraries) flag. The alternative install targets write
the implementation DSOs directly to the locations determined by their
sonames, skipping the creation of an intermediate symbolic link.

install-symbolic-link in Makerules is updated not to require the
$(symbolic-link-list) file because it may not exist in
--disable-major-minor-libraries mode.

I verified that by default, the install tree is the same as before
on x86_64-linux-gnu except for the changes in the manual.

fw/bug25225 2019-11-26 13:53:59 UTC
x86: Assume --enable-cet if GCC defaults to CET [BZ #25225]

Author: Florian Weimer
Author Date: 2019-11-26 13:48:56 UTC

x86: Assume --enable-cet if GCC defaults to CET [BZ #25225]

This links in CET support if GCC defaults to CET. Otherwise, __CET__
is defined, yet CET functionality is not compiled and linked into the
dynamic loader, resulting in a linker failure due to undefined
references to _dl_cet_check and _dl_open_check.

release/2.23/master 2019-11-22 13:09:58 UTC
rtld: Check __libc_enable_secure before honoring LD_PREFER_MAP_32BIT_EXEC (CV...

Author: Marcin Kościelnicki
Author Date: 2019-11-20 23:20:15 UTC

rtld: Check __libc_enable_secure before honoring LD_PREFER_MAP_32BIT_EXEC (CVE-2019-19126) [BZ #25204]

The problem was introduced in glibc 2.23, in commit
b9eb92ab05204df772eb4929eccd018637c9f3e9
("Add Prefer_MAP_32BIT_EXEC to map executable pages with MAP_32BIT").

(cherry picked from commit d5dfad4326fc683c813df1e37bbf5cf920591c8e)

fw/bug25097 2019-11-03 17:10:20 UTC
Redefine _IO_iconv_t to store a single gconv step pointer [BZ #25097]

Author: Florian Weimer
Author Date: 2019-11-03 10:39:56 UTC

Redefine _IO_iconv_t to store a single gconv step pointer [BZ #25097]

libio can only deal with gconv conversions which consist of a single
step. Not using __gconv_info simplifies the data structures somewhat.

This eliminates a new GCC 10 warning about subscribing an inner
zero-length array.

Tested on x86_64-linux-gnu with mainline GCC. Built with
build-many-glibcs.py, also with mainline GCC. Due to GCC PR 92039,
there are failures left on 32-bit architectures with float128 support.

Change-Id: I8b4c489b619a53154712ff32e1b6f13bb92d4203

fw/bug25157 2019-11-02 20:40:26 UTC
Properly initialize audit cookie for the dynamic loader [BZ #25157]

Author: Florian Weimer
Author Date: 2019-11-02 20:40:26 UTC

Properly initialize audit cookie for the dynamic loader [BZ #25157]

The l_audit array is indexed by audit module, not audit function.

fw/bug25112 2019-10-29 17:11:36 UTC
Remove all loaded objects if dlopen fails [BZ #20839]

Author: Florian Weimer
Author Date: 2019-10-28 18:49:46 UTC

Remove all loaded objects if dlopen fails [BZ #20839]

fw/elf-fixups 2019-10-29 11:23:48 UTC
Introduce DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x

Author: Florian Weimer
Author Date: 2019-10-29 11:23:48 UTC

Introduce DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x

This will allow changes in dependency processing during non-lazy
binding, for more precise processing of NODELETE objects: During
initial relocation in dlopen, the fate of NODELETE objects is still
unclear, so objects which are depended upon by NODELETE objects
cannot immediately be marked as NODELETE.

google/grte/v4-2.19/master 2019-08-14 17:20:07 UTC
Forestall a filesystem bug while building shlib.lds by using a temp file

Author: Stan Shebs
Author Date: 2019-08-14 17:20:07 UTC

Forestall a filesystem bug while building shlib.lds by using a temp file

arm/ilp32 2019-08-01 13:47:11 UTC
aarch64: Update ILP32 abilists for glibc 2.30

Author: Szabolcs Nagy
Author Date: 2019-08-01 13:47:11 UTC

aarch64: Update ILP32 abilists for glibc 2.30

This will need to be merged with the initial ilp32 abilist commit.

2019-08-01 Szabolcs Nagy <szabolcs.nagy@arm.com>

 * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update.
 * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Update.

zack/gtod-no-timezone 2019-07-28 00:14:35 UTC
Remove access to legacy time zone support in gettimeofday etc.

Author: Zack Weinberg
Author Date: 2019-07-27 23:26:23 UTC

Remove access to legacy time zone support in gettimeofday etc.

gettimeofday and ftime are not quite fully implementable on systems
that only provide a primitive equivalent to clock_gettime, because
they can also report information about a system-wide time zone. This
mechanism has been deprecated for many years because it can only be
configured on a system-wide basis, and because it only supports the
simplest kinds of daylight-savings rules, but we’ve supported it on a
best-effort basis until now. This patch removes our support for it:

 * The type 'struct timezone' is still declared as a complete type in
   <sys/time.h>, but code that uses its fields (tz_minuteswest and
   tz_dsttime) will not compile.

 * Similarly, code that uses the 'timezone' and 'dstflag' fields of
   struct timeb will not compile anymore. (This is a willful
   violation of the older iterations of XPG that included
   sys/timeb.h; the relevant conformance tests are XFAILed.)

 * Old binaries that pass a non-NULL 'tzp' pointer to gettimeofday
   will always receive a 'struct timezone' whose tz_minuteswest and
   tz_dsttime fields are zero (as if the system were operating on UTC).

 * Similarly, old binaries that call ftime will always receive a
   'struct timeb' whose timezone and dstflag fields are zero.

 * If the 'tzp' argument to settimeofday is not NULL, the call will fail
   and set errno to ENOSYS. (This was already the case on the Hurd.)

 * glibc will always pass a second argument of NULL when invoking a
   kernel-provided gettimeofday.

 * On Alpha, the compat symbols gettimeofday@GLIBC_2.0 and
   settimeofday@GLIBC_2.0 (which used 32-bit time_t) now convert
   their arguments and call system primitives that use 64-bit time_t,
   instead of invoking legacy “osf” system calls.

ChangeLog:

 * time/sys/time.h (struct timezone): Remove tz_minuteswest
 and tz_dsttime fields; replace with padding to preserve the size.
 * time/sys/timeb.h (struct timeb): Remove timezone and dstflag
 fields; replace with padding to preserve the size.
 * conform/Makefile: XFAIL tests because struct timeb is no longer
 fully conformant with Unix98.

 * sysdeps/posix/gettimeofday.c
 * sysdeps/unix/sysv/linux/gettimeofday.c
 * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
 * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
 * sysdeps/unix/sysv/linux/x86/gettimeofday.c
 (gettimeofday): When ‘tz’ argument is not NULL, just clear it.
 Always pass a null pointer as the second argument to a
 gettimeofday (v)syscall.

 * sysdeps/unix/bsd/ftime.c: Unconditionally clear the memory that
 was formerly the ‘timezone’ and ‘dstflag’ fields of struct timeb.

 * sysdeps/unix/syscalls.list: Remove entry for settimeofday.
 * sysdeps/unix/settimeofday.c: New file.
 (settimeofday): Fail with ENOSYS if ‘tz’ argument is not NULL.

 * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove entries for
        osf_gettimeofday, osf_settimeofday, and settimeofday.
 * sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c:
 New file. Call the 64-bit gettimeofday, then convert to a
 32-bit struct timeval. On overflow, saturate the struct timeval
 and fail with EOVERFLOW.
 * sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c: New file.
        Convert to a 64-bit struct timeval and call 64-bit settimeofday.
        Fail with ENOSYS if ‘tz’ argument is not NULL.

 * sunrpc/auth_des.c, sunrpc/auth_unix.c
 * sysdeps/posix/time.c, sysdeps/unix/stime.c:
 Remove unnecessary casts of NULL.

 * sysdeps/unix/sysv/linux/powerpc/time.c (time_syscall):
 Use (void *)0 instead of NULL when passing a null pointer
 as an untyped argument.

 * manual/time.texi: Remove documentation of fields of
 struct timezone. Revise text to further emphasize that
 the second argument to gettimeofday/settimeofday should
 always be a null pointer.

fw/getdents64 2019-07-25 10:48:41 UTC
Linux: Move getdents64 to <dirent.h>

Author: Florian Weimer
Author Date: 2019-07-25 10:48:41 UTC

Linux: Move getdents64 to <dirent.h>

This matches the location of the declaration in musl.

fw/gcc-10-fixes 2019-07-22 12:02:40 UTC
nptl: Use uintptr_t for address diagnostic in nptl/tst-pthread-getattr

Author: Florian Weimer
Author Date: 2019-07-22 12:02:40 UTC

nptl: Use uintptr_t for address diagnostic in nptl/tst-pthread-getattr

Recent GCC versions warn about the attempt to return the address of a
local variable:

tst-pthread-getattr.c: In function ‘allocate_and_test’:
tst-pthread-getattr.c:54:10: error: function returns address of local variable [-Werror=return-local-addr]
   54 | return mem;
      | ^~~
In file included from ../include/alloca.h:3,
                 from tst-pthread-getattr.c:26:
../stdlib/alloca.h:35:23: note: declared here
   35 | # define alloca(size) __builtin_alloca (size)
      | ^~~~~~~~~~~~~~~~~~~~~~~
tst-pthread-getattr.c:51:9: note: in expansion of macro ‘alloca’
   51 | mem = alloca ((size_t) (mem - target));
      | ^~~~~~

The address itself is used in a check in the caller, so using
uintptr_t instead is reasonable.

fw/linux-5.2 2019-07-22 09:01:17 UTC
Linux: Include <linux/sockios.h> in <bits/socket.h> under __USE_MISC

Author: Florian Weimer
Author Date: 2019-07-22 09:01:17 UTC

Linux: Include <linux/sockios.h> in <bits/socket.h> under __USE_MISC

Historically, <asm/socket.h> (which is included from <bits/socket.h>)
provided ioctl operations for sockets. User code accessed them
through <sys/socket.h>. The kernel UAPI headers have removed these
definitions in favor of <linux/sockios.h>. This commit makes them
available via <sys/socket.h> again.

nsz/mathvec 2019-07-16 10:01:51 UTC
aarch64: add vector sin, cos, log and pow abi symbols

Author: Szabolcs Nagy
Author Date: 2019-06-28 14:23:27 UTC

aarch64: add vector sin, cos, log and pow abi symbols

Add simple assembly implementations that fall back to scalar code,
similar to the vector exp code.

2019-07-15 Szabolcs Nagy <szabolcs.nagy@arm.com>

 * sysdeps/aarch64/fpu/Makefile: Add functions.
 * sysdeps/aarch64/fpu/Versions: Add symbols.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_cos.S: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_log.S: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_pow.S: New file.
 * sysdeps/aarch64/fpu/libmvec_double_vlen2_sin.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_cosf.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_logf.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_powf.S: New file.
 * sysdeps/aarch64/fpu/libmvec_float_vlen4_sinf.S: New file.
 * sysdeps/aarch64/fpu/test-double-vlen2-wrappers.c: Add wrappers.
 * sysdeps/aarch64/fpu/test-float-vlen4-wrappers.c: Add wrappers.
 * sysdeps/aarch64/libm-test-ulps: Update.
 * sysdeps/unix/sysv/linux/aarch64/libmvec.abilist: Update.

azanella/atexit-order 2019-07-11 18:49:24 UTC
stdlib: Make atexit to not act as __cxa_atexit

Author: Adhemerval Zanella
Author Date: 2019-06-12 13:37:11 UTC

stdlib: Make atexit to not act as __cxa_atexit

This is patch to addresses the issue brought in recent discussion
regarding atexit and shared libraries [1] [2]. As indicated in the
libc-alpha discussion, the issue is since atexit uses __cxa_atexit
its interaction __cxa_finalize could lead to atexit handlers being
executed in a different order than the expected one. The github
project gives a small example that triggers it [3].

The changes I could come with changes slight the atexit semantic
as described in my last email [4]. So basically the changes are:

  1. Add the __atexit symbol which is linked as __cxa_finalize in
     static mode (so __dso_handle is correctly set). The __atexit
     symbol adds an ef_at exit_function entry on __exit_funcs,
     different than an ef_cxa one from __cxa_atexit.

     Old binaries would still call __cxa_atexit, so we do not actually
     need to add a compat symbol.

  2. Make __cxa_finalize to handle ef_at as well, similar to ef_cxa.

  3. Change how the internal exit handler are organized, so ef_at
     and ef_on handles (registered by atexit and on_exit) are executed
     before ef_cxa (registered by __cxa_atexit).

     Each entry set (struct exit_function_list) has on type associated
     (el_at or el_cxa) to represent the internal handle it contains.
     New insertions (done by the __atexit, __cxa_atexit, etc.) keep the
     node orders, with following constraints:

     3.1. el_at nodes should be prior el_cxa.
     3.2. el_at should contain only ef_at, ef_on, or ef_free elements.
     3.3. el_cxa should contain only ef_cxa or ef_free elements.
     3.4. new insertions on each node type should be be kept in lifo order.
     3.5. the original first element should be last one (since it is static
          allocated and 'exit' will deallocated the nodes in order. */

     So the execution on both __cxa_finalize, exit, or quick_exit will
     iterate over the list by executing first atexit/on_exit handlers and
     then __cxa_atexit ones. New handlers added by registered functions
     are handled as before, by using the ef_free entry and reseting the
     list iteration.

[1] https://sourceware.org/ml/libc-alpha/2019-06/msg00229.html
[2] https://sourceware.org/ml/libc-help/2019-06/msg00025.html
[3] https://github.com/mulle-nat/ld-so-breakage
[4] https://sourceware.org/ml/libc-alpha/2019-06/msg00231.html

fw/resolv-cleanups 2019-05-17 09:10:51 UTC
nss_dns: Remove RES_USE_INET6 handling

Author: Florian Weimer
Author Date: 2019-05-17 09:10:51 UTC

nss_dns: Remove RES_USE_INET6 handling

Since commit 3f8b44be0a658266adff5ece1e4bc3ce097a5dbe ("resolv:
Remove support for RES_USE_INET6 and the inet6 option"),
res_use_inet6 () always evaluates to false.

fw/bug24562 2019-05-16 10:08:38 UTC
WIP Support exotic character sets in __fxprintf [BZ #24562]

Author: Florian Weimer
Author Date: 2019-05-16 10:08:37 UTC

WIP Support exotic character sets in __fxprintf [BZ #24562]

This does not quite work because vfprintf has a similar
incorrect assumption.

fw/tst-mallocfork2 2019-05-03 15:46:36 UTC
malloc/tst-mallocfork2: Use process-shared barriers

Author: Florian Weimer
Author Date: 2019-05-03 15:46:36 UTC

malloc/tst-mallocfork2: Use process-shared barriers

This synchronization method has a lower overhead and makes
it more likely that the signal arrives during one of the critical
functions.

Also test for fork deadlocks explicitly.

fw/twalk_r-iconv 2019-05-02 10:37:21 UTC
iconv: Use __twalk_r in __gconv_release_shlib

Author: Florian Weimer
Author Date: 2019-05-02 10:37:21 UTC

iconv: Use __twalk_r in __gconv_release_shlib

google/grte/v6-2.29/master 2019-05-01 01:24:46 UTC
As with gettimeofday, avoid vdso for clang-compiled time()

Author: Stan Shebs
Author Date: 2018-03-13 18:37:02 UTC

As with gettimeofday, avoid vdso for clang-compiled time()

fw/bug21242 2019-04-15 15:39:45 UTC
ld.so: Introduce delayed relocation processing

Author: Florian Weimer
Author Date: 2018-06-06 14:02:02 UTC

ld.so: Introduce delayed relocation processing

This makes it possible to use IFUNC resolvers which depend
on relocations themselves, as long as these reloctions do
not depend on IFUNCs.

So far, delayed relocation processing is only implemented for
x86-64.

fw/bug20018-backport 2019-02-04 14:47:59 UTC
Restore GLIBC_PRIVATE ABI after CVE-2016-10739 fix [BZ #20018]

Author: Florian Weimer
Author Date: 2019-02-04 14:47:59 UTC

Restore GLIBC_PRIVATE ABI after CVE-2016-10739 fix [BZ #20018]

This commit avoids adding the __inet_aton_exact@GLIBC_PRIVATE
symbol. In master, the separately-compiled getaddrinfo
implementation in nscd needs it, however such an internal ABI change
is not desirable on a release branch if it can be avoided easily.

siddhesh/changelog-begone 2019-01-12 11:16:42 UTC
Another major update

Author: Siddhesh Poyarekar
Author Date: 2019-01-12 11:09:16 UTC

Another major update

aaribaud/bugzilla/23789/v4 2018-11-02 06:03:52 UTC
Ensure mktime sets errno on error [BZ #23789]

Author: Albert ARIBAUD (3ADEV)
Author Date: 2018-10-24 12:43:06 UTC

Ensure mktime sets errno on error [BZ #23789]

Posix mandates that mktime set errno to EOVERFLOW
on error, but the glibc mktime wasn't doing it so
far.

Fix this and add a test to prevent regressions.
The fix also fixes the same issue in timegm.

Tested with 'make check' on x86-linux-gnu and
i686-linux-gnu.

        * time/Makefile: Add bug-mktime4.
 * time/bug-mktime4.c: New file.
 * time/mktime.c
 (__mktime_internal): Set errno to EOVERFLOW on error.
 (mktime): Move call to __tzset inside conditional.

aaribaud/bugzilla/23789/v2 2018-10-27 15:18:02 UTC
Ensure mktime sets errno on error (bug 23789)

Author: Albert ARIBAUD (3ADEV)
Author Date: 2018-10-24 12:43:06 UTC

Ensure mktime sets errno on error (bug 23789)

Posix mandates that mktime set errno to EOVERFLOW
on error, that it, upon retuning -1, but the glibc
mktime does not so far on 32-bit architectures.

Fix this and add a test to prevent regressions.

The test was run through 'make check' on i686-linux-gnu,
then the fix was added and 'make check' run again.

 * time/mktime.c
 (mktime): Set errno to EOVERFLOW on error.
 * time/bug-mktime4.c: New file.
        * time/Makefile: Add bug-mktime4.

aaribaud/y2038 2018-10-24 10:53:27 UTC
Y2038: add _TIME_BITS support

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-09-06 08:00:42 UTC

Y2038: add _TIME_BITS support

This makes all previously defined Y2038-proof API types, functions and
implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
that 64-bit architectures are unaffected).

Note: it is assumed that the API is consistent, i.e. for each API type
which is enabled here, all API functions which depend on this type are
enabled and mapped to Y2038-proof implementations.

azanella/aarch64-mempcpy 2018-07-05 12:18:18 UTC
aarch64: ifunc mem* cleanups

Author: Adhemerval Zanella
Author Date: 2018-07-05 12:08:16 UTC

aarch64: ifunc mem* cleanups

aaribaud/y2038-submitted-v1 2018-06-13 08:21:00 UTC
Y2038: make __mktime_internal compatible with 64-bit-time

Author: Albert ARIBAUD (3ADEV)
Author Date: 2018-05-02 11:15:50 UTC

Y2038: make __mktime_internal compatible with 64-bit-time

This implies that its callers be 64-bit-time compatible too.
It is done by creating 64-bit-time versions of these and
turning their original 32-bit-time versions into wrappers
(at a slight execution time cost).

The callers affected are:

      * mktime
      * timelocal (as an alias of mktime)
      * timegm

zack/elf-builtin-expect-conversion 2018-06-12 14:02:27 UTC
Convert __builtin_expect to __glibc_(un)likely throughout elf/.

Author: Zack Weinberg
Author Date: 2018-06-01 16:53:59 UTC

Convert __builtin_expect to __glibc_(un)likely throughout elf/.

In the previous patch I didn't change a use of __builtin_expect to
__glibc_(un)likely that happened to be right next to the code I was
actually working on; Andreas asked why not, and I said that there were
a bunch more uses of __builtin_expect in that file and I would convert
them all in a separate patch. This is that patch, converting all of
elf/.

I would appreciate someone checking over this patch very carefully
indeed. In a whole bunch of places, __builtin_expect was used in a
way that did not map mechanically to the newer convention. The test
suite caught one mistake; I'm not confident I didn't make any more.

Writing this patch gave me a deeper appreciation for why we _want_ to
switch to __glibc_(un)likely, but also for how difficult it can be. I
now think that people should _not_ be asked to change existing uses of
__builtin_expect in a patch whose purpose is something else.

 * elf/dl-addr.c, elf/dl-cache.c, elf/dl-close.c, elf/dl-deps.c
 * elf/dl-environ.c, elf/dl-error-skeleton.c, elf/dl-fini.c
 * elf/dl-fptr.c, elf/dl-init.c, elf/dl-libc.c, elf/dl-minimal.c
 * elf/dl-open.c, elf/dl-reloc.c, elf/dl-runtime.c
 * elf/dl-sysdep.c, elf/dl-tls.c, elf/dl-version.c, elf/ldconfig.c
 * elf/rtld.c: Replace __builtin_expect with __glibc_likely or
 __glibc_unlikely, as appropriate, throughout.

hjl/pr23240/fw 2018-06-06 15:32:12 UTC
Check non-lazy binding with LD_PRELOAD and weak reference

Author: H.J. Lu
Author Date: 2018-05-27 14:15:35 UTC

Check non-lazy binding with LD_PRELOAD and weak reference

Check non-lazy binding with

1. Reference to unrelocated IFUNC function with LD_PRELOAD.
2. Weak reference.

 [BZ #23176]
 [BZ #23240]
 * elf/Makefile (tests): Add reldep6a.
 (tests-internal): Add ifuncpreload1
 (modules-names): Add ifuncpreloadmod1a and ifuncpreloadmod1b.
 ($(objpfx)reldep6a): New.
 ($(objpfx)reldep6a.out): Likewise.
 (reldep6a-ENV): Likewise.
 ($(objpfx)ifuncpreload1): Likewise.
 ($(objpfx)ifuncpreload1.out): Likewise.
 (ifuncpreload1-ENV): Likewise.
 * elf/ifuncpreload1.c: New file.
 * elf/ifuncpreloadmod1a.c: Likewise.
 * elf/ifuncpreloadmod1b.c: Likewise.
 * elf/reldep6a.c: Likewise.

fw/libm-noprivate-2.27 2018-05-10 10:42:05 UTC
Use custom x86 feature selection in libm

Author: Florian Weimer
Author Date: 2018-05-10 09:50:00 UTC

Use custom x86 feature selection in libm

ibm/2.22/master 2018-04-19 18:21:54 UTC
Merge branch 'release/2.22/master' into ibm/2.22/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2018-04-19 18:21:54 UTC

Merge branch 'release/2.22/master' into ibm/2.22/master

release/2.22/master 2018-04-13 17:30:20 UTC
glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]

Author: Paul Eggert
Author Date: 2017-10-22 08:00:57 UTC

glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]

(cherry picked from commit a159b53fa059947cc2548e3b0d5bdcf7b9630ba8)

zack/wip-check-localplt-2 2018-03-26 13:05:19 UTC
WIP finer-grained, more aggressive local PLT call check

Author: Zack Weinberg
Author Date: 2018-03-18 21:01:06 UTC

WIP finer-grained, more aggressive local PLT call check

1100 of 330 results

Other repositories

Name Last Modified
lp:glibc 16 hours ago
11 of 1 result
You can't create new repositories for GLibC.