Skip to content

Commit 1fcaca5

Browse files
alexrpIgor Stojkovic
authored and
Igor Stojkovic
committed
Update glibc start files to 2.40.
1 parent 2a5a1c5 commit 1fcaca5

File tree

21 files changed

+401
-78
lines changed

21 files changed

+401
-78
lines changed

lib/libc/glibc/bits/libc-header-start.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@
4444

4545
/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
4646
macro. Most but not all symbols enabled by that macro in TS
47-
18661-1 are enabled unconditionally in C2X. In C2X, the symbols in
47+
18661-1 are enabled unconditionally in C23. In C23, the symbols in
4848
Annex F still require a new feature test macro
49-
__STDC_WANT_IEC_60559_EXT__ instead (C2X does not define
49+
__STDC_WANT_IEC_60559_EXT__ instead (C23 does not define
5050
__STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS
51-
18661-1 are not included in C2X (and thus should depend on
52-
__STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are
51+
18661-1 are not included in C23 (and thus should depend on
52+
__STDC_WANT_IEC_60559_BFP_EXT__ even when C23 features are
5353
enabled).
5454
5555
__GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS
56-
18661-1 not included in C2X.
56+
18661-1 not included in C23.
5757
58-
__GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS
59-
18661-1 that are also included in C2X (with no feature test macro
60-
required in C2X).
58+
__GLIBC_USE (IEC_60559_BFP_EXT_C23) controls those features from TS
59+
18661-1 that are also included in C23 (with no feature test macro
60+
required in C23).
6161
6262
__GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1
63-
that are included in C2X but conditional on
63+
that are included in C23 but conditional on
6464
__STDC_WANT_IEC_60559_EXT__. (There are currently no features
6565
conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS
6666
18661-1.) */
@@ -70,11 +70,11 @@
7070
#else
7171
# define __GLIBC_USE_IEC_60559_BFP_EXT 0
7272
#endif
73-
#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X
74-
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X)
75-
# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1
73+
#undef __GLIBC_USE_IEC_60559_BFP_EXT_C23
74+
#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC23)
75+
# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 1
7676
#else
77-
# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0
77+
# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 0
7878
#endif
7979
#undef __GLIBC_USE_IEC_60559_EXT
8080
#if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__
@@ -86,18 +86,18 @@
8686
/* ISO/IEC TS 18661-4:2015 defines the
8787
__STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction
8888
functions, the symbols from this TS are enabled unconditionally in
89-
C2X. */
89+
C23. */
9090
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT
9191
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__
9292
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1
9393
#else
9494
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
9595
#endif
96-
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
97-
#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X)
98-
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1
96+
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C23
97+
#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC23)
98+
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 1
9999
#else
100-
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0
100+
# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 0
101101
#endif
102102

103103
/* ISO/IEC TS 18661-3:2015 defines the

lib/libc/glibc/elf/elf.h

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,10 @@ typedef struct
831831
control. */
832832
#define NT_ARM_PAC_ENABLED_KEYS 0x40a /* AArch64 pointer authentication
833833
enabled keys. */
834+
#define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers. */
835+
#define NT_ARM_ZA 0x40c /* ARM SME ZA registers. */
836+
#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */
837+
#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */
834838
#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
835839
#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
836840
#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
@@ -1234,6 +1238,10 @@ typedef struct
12341238
#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size. */
12351239
#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment. */
12361240

1241+
/* More machine-dependent hints about processor capabilities. */
1242+
#define AT_HWCAP3 29 /* extension of AT_HWCAP. */
1243+
#define AT_HWCAP4 30 /* extension of AT_HWCAP. */
1244+
12371245
#define AT_EXECFN 31 /* Filename of executable. */
12381246

12391247
/* Pointer to the global system page used for system calls and other
@@ -1333,9 +1341,13 @@ typedef struct
13331341
#define NT_GNU_PROPERTY_TYPE_0 5
13341342

13351343
/* Packaging metadata as defined on
1336-
https://systemd.io/COREDUMP_PACKAGE_METADATA/ */
1344+
https://systemd.io/ELF_PACKAGE_METADATA/ */
13371345
#define NT_FDO_PACKAGING_METADATA 0xcafe1a7e
13381346

1347+
/* dlopen metadata as defined on
1348+
https://systemd.io/ELF_DLOPEN_METADATA/ */
1349+
#define NT_FDO_DLOPEN_METADATA 0x407c0c0a
1350+
13391351
/* Note section name of program property. */
13401352
#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
13411353

@@ -4237,6 +4249,8 @@ enum
42374249
#define R_LARCH_TLS_TPREL32 10
42384250
#define R_LARCH_TLS_TPREL64 11
42394251
#define R_LARCH_IRELATIVE 12
4252+
#define R_LARCH_TLS_DESC32 13
4253+
#define R_LARCH_TLS_DESC64 14
42404254

42414255
/* Reserved for future relocs that the dynamic linker must understand. */
42424256

@@ -4331,6 +4345,23 @@ enum
43314345
#define R_LARCH_ADD_ULEB128 107
43324346
#define R_LARCH_SUB_ULEB128 108
43334347
#define R_LARCH_64_PCREL 109
4348+
#define R_LARCH_CALL36 110
4349+
#define R_LARCH_TLS_DESC_PC_HI20 111
4350+
#define R_LARCH_TLS_DESC_PC_LO12 112
4351+
#define R_LARCH_TLS_DESC64_PC_LO20 113
4352+
#define R_LARCH_TLS_DESC64_PC_HI12 114
4353+
#define R_LARCH_TLS_DESC_HI20 115
4354+
#define R_LARCH_TLS_DESC_LO12 116
4355+
#define R_LARCH_TLS_DESC64_LO20 117
4356+
#define R_LARCH_TLS_DESC64_HI12 118
4357+
#define R_LARCH_TLS_DESC_LD 119
4358+
#define R_LARCH_TLS_DESC_CALL 120
4359+
#define R_LARCH_TLS_LE_HI20_R 121
4360+
#define R_LARCH_TLS_LE_ADD_R 122
4361+
#define R_LARCH_TLS_LE_LO12_R 123
4362+
#define R_LARCH_TLS_LD_PCREL20_S2 124
4363+
#define R_LARCH_TLS_GD_PCREL20_S2 125
4364+
#define R_LARCH_TLS_DESC_PCREL20_S2 126
43344365

43354366
/* ARC specific declarations. */
43364367

lib/libc/glibc/include/libc-symbols.h

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -679,23 +679,23 @@ for linking")
679679
#endif
680680

681681
/* Helper / base macros for indirect function symbols. */
682-
#define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
682+
#define __ifunc_resolver(type_name, name, expr, init, classifier, ...) \
683683
classifier inhibit_stack_protector \
684-
__typeof (type_name) *name##_ifunc (arg) \
684+
__typeof (type_name) *name##_ifunc (__VA_ARGS__) \
685685
{ \
686686
init (); \
687687
__typeof (type_name) *res = expr; \
688688
return res; \
689689
}
690690

691691
#ifdef HAVE_GCC_IFUNC
692-
# define __ifunc(type_name, name, expr, arg, init) \
692+
# define __ifunc_args(type_name, name, expr, init, ...) \
693693
extern __typeof (type_name) name __attribute__ \
694694
((ifunc (#name "_ifunc"))); \
695-
__ifunc_resolver (type_name, name, expr, arg, init, static)
695+
__ifunc_resolver (type_name, name, expr, init, static, __VA_ARGS__)
696696

697-
# define __ifunc_hidden(type_name, name, expr, arg, init) \
698-
__ifunc (type_name, name, expr, arg, init)
697+
# define __ifunc_args_hidden(type_name, name, expr, init, ...) \
698+
__ifunc_args (type_name, name, expr, init, __VA_ARGS__)
699699
#else
700700
/* Gcc does not support __attribute__ ((ifunc (...))). Use the old behaviour
701701
as fallback. But keep in mind that the debug information for the ifunc
@@ -706,18 +706,24 @@ for linking")
706706
different signatures. (Gcc support is disabled at least on a ppc64le
707707
Ubuntu 14.04 system.) */
708708

709-
# define __ifunc(type_name, name, expr, arg, init) \
709+
# define __ifunc_args(type_name, name, expr, init, ...) \
710710
extern __typeof (type_name) name; \
711-
__typeof (type_name) *name##_ifunc (arg) __asm__ (#name); \
712-
__ifunc_resolver (type_name, name, expr, arg, init,) \
711+
__typeof (type_name) *name##_ifunc (__VA_ARGS__) __asm__ (#name); \
712+
__ifunc_resolver (type_name, name, expr, init, , __VA_ARGS__) \
713713
__asm__ (".type " #name ", %gnu_indirect_function");
714714

715-
# define __ifunc_hidden(type_name, name, expr, arg, init) \
715+
# define __ifunc_args_hidden(type_name, name, expr, init, ...) \
716716
extern __typeof (type_name) __libc_##name; \
717-
__ifunc (type_name, __libc_##name, expr, arg, init) \
717+
__ifunc (type_name, __libc_##name, expr, __VA_ARGS__, init) \
718718
strong_alias (__libc_##name, name);
719719
#endif /* !HAVE_GCC_IFUNC */
720720

721+
#define __ifunc(type_name, name, expr, arg, init) \
722+
__ifunc_args (type_name, name, expr, init, arg)
723+
724+
#define __ifunc_hidden(type_name, name, expr, arg, init) \
725+
__ifunc_args_hidden (type_name, name, expr, init, arg)
726+
721727
/* The following macros are used for indirect function symbols in libc.so.
722728
First of all, you need to have the function prototyped somewhere,
723729
say in foo.h:

lib/libc/glibc/include/stdlib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ libc_hidden_proto (__isoc23_strtoul_l)
5353
libc_hidden_proto (__isoc23_strtoll_l)
5454
libc_hidden_proto (__isoc23_strtoull_l)
5555

56-
#if __GLIBC_USE (C2X_STRTOL)
57-
/* Redirect internal uses of these functions to the C2X versions; the
56+
#if __GLIBC_USE (C23_STRTOL)
57+
/* Redirect internal uses of these functions to the C23 versions; the
5858
redirection in the installed header does not work with
5959
libc_hidden_proto. */
6060
# undef strtol

lib/libc/glibc/io/fcntl.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ typedef __pid_t pid_t;
176176
177177
This function is a cancellation point and therefore not marked with
178178
__THROW. */
179-
#ifndef __USE_TIME_BITS64
179+
#ifndef __USE_TIME64_REDIRECTS
180180
# ifndef __USE_FILE_OFFSET64
181181
extern int fcntl (int __fd, int __cmd, ...);
182182
# else
@@ -189,7 +189,7 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
189189
# ifdef __USE_LARGEFILE64
190190
extern int fcntl64 (int __fd, int __cmd, ...);
191191
# endif
192-
#else /* __USE_TIME_BITS64 */
192+
#else /* __USE_TIME64_REDIRECTS */
193193
# ifdef __REDIRECT
194194
extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...),
195195
__fcntl_time64);
@@ -344,8 +344,7 @@ extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
344344

345345

346346
/* Define some inlines helping to catch common problems. */
347-
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \
348-
&& defined __va_arg_pack_len
347+
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
349348
# include <bits/fcntl2.h>
350349
#endif
351350

lib/libc/glibc/io/sys/stat.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ extern int stat (const char *__restrict __file,
209209
that file descriptor FD is open on and put them in BUF. */
210210
extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
211211
#else
212-
# ifdef __USE_TIME_BITS64
212+
# ifdef __USE_TIME64_REDIRECTS
213213
# ifdef __REDIRECT_NTH
214214
extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
215215
struct stat *__restrict __buf),
@@ -236,7 +236,7 @@ extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
236236
# endif
237237
#endif
238238
#ifdef __USE_LARGEFILE64
239-
# ifndef __USE_TIME_BITS64
239+
# ifndef __USE_TIME64_REDIRECTS
240240
extern int stat64 (const char *__restrict __file,
241241
struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
242242
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
@@ -265,7 +265,7 @@ extern int fstatat (int __fd, const char *__restrict __file,
265265
struct stat *__restrict __buf, int __flag)
266266
__THROW __nonnull ((2, 3));
267267
# else
268-
# ifdef __USE_TIME_BITS64
268+
# ifdef __USE_TIME64_REDIRECTS
269269
# ifdef __REDIRECT_NTH
270270
extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
271271
struct stat *__restrict __buf,
@@ -287,7 +287,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
287287
# endif
288288

289289
# ifdef __USE_LARGEFILE64
290-
# ifndef __USE_TIME_BITS64
290+
# ifndef __USE_TIME64_REDIRECTS
291291
extern int fstatat64 (int __fd, const char *__restrict __file,
292292
struct stat64 *__restrict __buf, int __flag)
293293
__THROW __nonnull ((2, 3));
@@ -313,7 +313,7 @@ extern int __REDIRECT_NTH (fstatat64, (int __fd,
313313
extern int lstat (const char *__restrict __file,
314314
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
315315
# else
316-
# ifdef __USE_TIME_BITS64
316+
# ifdef __USE_TIME64_REDIRECTS
317317
# ifdef __REDIRECT_NTH
318318
extern int __REDIRECT_NTH (lstat,
319319
(const char *__restrict __file,
@@ -334,7 +334,7 @@ extern int __REDIRECT_NTH (lstat,
334334
# endif
335335
# endif
336336
# ifdef __USE_LARGEFILE64
337-
# ifndef __USE_TIME_BITS64
337+
# ifndef __USE_TIME64_REDIRECTS
338338
extern int lstat64 (const char *__restrict __file,
339339
struct stat64 *__restrict __buf)
340340
__THROW __nonnull ((1, 2));
@@ -427,7 +427,7 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
427427
#endif
428428

429429
#ifdef __USE_ATFILE
430-
# ifndef __USE_TIME_BITS64
430+
# ifndef __USE_TIME64_REDIRECTS
431431
/* Set file access and modification times relative to directory file
432432
descriptor. */
433433
extern int utimensat (int __fd, const char *__path,
@@ -447,7 +447,7 @@ extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,
447447
#endif
448448

449449
#ifdef __USE_XOPEN2K8
450-
# ifndef __USE_TIME_BITS64
450+
# ifndef __USE_TIME64_REDIRECTS
451451
/* Set file access and modification times of the file associated with FD. */
452452
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
453453

0 commit comments

Comments
 (0)