After six months of development, the release of the GNU C Library (glibc) 2.36 has been published, which fully complies with the requirements of the ISO C11 and POSIX.1-2017 standards. The new release includes fixes from 59 developers.
Among the improvements implemented in Glibc 2.36 are:
- Support for the new format of relative address relocations DT_RELR has been added, which allows for a reduction in the size of relative relocations in shared objects and executables compiled in Position-independent executables (PIE) mode. To use the DT_RELR field in ELF files, support for the "-z pack-relative-relocs" option in the linker is required, which appeared in the binutils 2.38 release.
- For the Linux platform, the functions pidfd_open, pidfd_getfd, and pidfd_send_signal have been implemented, providing access to pidfd functionality, which helps handle scenarios with PID reuse for more accurate identification of processes accessing tracked files (pidfd is bound to a specific process and does not change, while PID may be reassigned to another process after the current process associated with that PID ends).
- For the Linux platform, the process_madvise() function has been added, allowing one process to make the madvise() system call on behalf of another process, identifying the target process using pidfd. Through madvise(), the kernel can be informed about memory usage patterns to optimize memory management for the process; for example, based on the provided information, the kernel may initiate the release of additional free memory. The madvise() call by another process may be necessary when the optimization information needed is unknown to the current process and is coordinated by a separate background management process that can independently initiate reclamation of unused memory from processes.
- A new function, process_mrelease(), has been added to the Linux platform, allowing for faster memory release of processes that are completing their execution. Under normal conditions, resource release and process termination are not instantaneous and may be delayed for various reasons, which hinders the operation of user-space systems designed for rapid response to low memory situations, such as oomd (provided in systemd). With the process_mrelease call, such systems can more predictably initiate the return of memory from forcibly terminated processes.
- The built-in DNS resolver has added support for the 'no-aaaa' option, which allows disabling the sending of DNS requests for AAAA records (IPv6 address resolution by hostname) to simplify troubleshooting, including during NSS functions like getaddrinfo(). The option does not affect the handling of IPv6 address bindings defined in /etc/hosts and calls to getaddrinfo() with the AI_PASSIVE flag.
- New functions fsopen, fsmount, move_mount, fsconfig, fspick, open_tree, and mount_setattr have been added to the Linux platform, providing access to a new kernel API for managing file system mounts with consideration for mount namespaces. The proposed functions allow separate handling of different stages of mounting (handling the superblock, obtaining FS information, mounting, attaching to a mount point) that were previously performed using a single mount() function. The separate functions enable more complex mounting scenarios and allow for specific operations such as superblock reconfiguration, enabling options, changing mount points, and moving to another namespace. Additionally, separate processing allows for precise identification of error code causes and the specification of multiple sources for layered filesystems, such as overlayfs.
- Support has been implemented in localedef for processing locale definition files supplied in UTF-8 encoding instead of ASCII.
- Functions for converting multibyte encodings, mbrtoc8 and c8rtomb, corresponding to ISO C2X N2653 and C++20 P0482R6 specifications have been added.
- Support for the char8_t type, defined in the draft standard ISO C2X N2653, has been added.
- Functions arc4random, arc4random_buf, and arc4random_uniform have been added, providing wrappers over the system call getrandom and the /dev/urandom interface, returning high-quality pseudorandom numbers.
- Support for the LoongArch instruction set architecture has been implemented on the Linux platform, used in Loongson 3 5000 processors, which implements a new RISC ISA similar to MIPS and RISC-V. Currently, only the 64-bit version of LoongArch (LA64) is available. It requires at least binutils version 2.38, GCC version 12, and Linux kernel version 5.19.
- The prelink mechanism has been deprecated and will be removed in the next release, along with the related environment variables LD_TRACE_PRELINKING and LD_USE_LOAD_BIAS and linker capabilities.
- The code for checking the Linux kernel version and handling the LD_ASSUME_KERNEL environment variable has been removed. The minimum supported Glibc kernel version is now determined through the ELF field NT_GNU_ABI_TAG.
- Support for the LD_LIBRARY_VERSION environment variable has been discontinued on the Linux platform.
Source: opennet.ru
