authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-11 19:54:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-13 17:44:27-07:00
log2314051acaad37dd5630dd7eca08571d620d6496
tree06cb3422b4237bd38ff4ac2c3c5a8f9f8324fcf7
parent87b3e2317294186ba6625592eb55760fd99fe211

update glibc start files to 2.38

I went ahead and left the README.md file deleted because it had broken git hashes. Better to use `git log -- lib/libc/glibc/` to find out the patches.

264 files changed, 1248 insertions(+), 1997 deletions(-)

lib/libc/glibc/README.md deleted-9
......@@ -1,9 +0,0 @@
1glibc headers are slightly patched for backwards compatibility. This is not
2good, because it requires to maintain our patchset whlist upgrading glibc.
3
4Until universal headers are real and this file can be removed, these commits
5need to be cherry-picked in the future glibc header upgrades:
6
7- 39083c31a550ed80f369f60d35791e98904b8096
8- a89813ef282c092a9caf699731c7faaf485acabe
9- 3eaca9bbc6fee4b6be0f22b844f7d3214222f434
lib/libc/glibc/bits/byteswap.h+1-1
......@@ -1,5 +1,5 @@
11/* Macros and inline functions to swap the order of bytes in integer values.
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 Copyright (C) 1997-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/floatn-common.h+21-21
......@@ -1,6 +1,6 @@
11/* Macros to control TS 18661-3 glibc features where the same
22 definitions are appropriate for all platforms.
3 Copyright (C) 2017-2021 Free Software Foundation, Inc.
3 Copyright (C) 2017-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -78,7 +78,7 @@
7878 or _FloatNx types, if __HAVE_<type> is 1. The corresponding
7979 literal suffixes exist since GCC 7, for C only. */
8080# if __HAVE_FLOAT16
81# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
81# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
8282/* No corresponding suffix available for this type. */
8383# define __f16(x) ((_Float16) x##f)
8484# else
......@@ -87,7 +87,7 @@
8787# endif
8888
8989# if __HAVE_FLOAT32
90# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
90# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
9191# define __f32(x) x##f
9292# else
9393# define __f32(x) x##f32
......@@ -95,7 +95,7 @@
9595# endif
9696
9797# if __HAVE_FLOAT64
98# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
98# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
9999# ifdef __NO_LONG_DOUBLE_MATH
100100# define __f64(x) x##l
101101# else
......@@ -107,7 +107,7 @@
107107# endif
108108
109109# if __HAVE_FLOAT32X
110# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
110# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
111111# define __f32x(x) x
112112# else
113113# define __f32x(x) x##f32x
......@@ -115,7 +115,7 @@
115115# endif
116116
117117# if __HAVE_FLOAT64X
118# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
118# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
119119# if __HAVE_FLOAT64X_LONG_DOUBLE
120120# define __f64x(x) x##l
121121# else
......@@ -127,7 +127,7 @@
127127# endif
128128
129129# if __HAVE_FLOAT128X
130# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
130# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
131131# error "_Float128X supported but no constant suffix"
132132# else
133133# define __f128x(x) x##f128x
......@@ -136,7 +136,7 @@
136136
137137/* Defined to a complex type if __HAVE_<type> is 1. */
138138# if __HAVE_FLOAT16
139# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
139# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
140140typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
141141# define __CFLOAT16 __cfloat16
142142# else
......@@ -145,7 +145,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
145145# endif
146146
147147# if __HAVE_FLOAT32
148# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
148# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
149149# define __CFLOAT32 _Complex float
150150# else
151151# define __CFLOAT32 _Complex _Float32
......@@ -153,7 +153,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
153153# endif
154154
155155# if __HAVE_FLOAT64
156# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
156# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
157157# ifdef __NO_LONG_DOUBLE_MATH
158158# define __CFLOAT64 _Complex long double
159159# else
......@@ -165,7 +165,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
165165# endif
166166
167167# if __HAVE_FLOAT32X
168# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
168# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
169169# define __CFLOAT32X _Complex double
170170# else
171171# define __CFLOAT32X _Complex _Float32x
......@@ -173,7 +173,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
173173# endif
174174
175175# if __HAVE_FLOAT64X
176# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
176# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
177177# if __HAVE_FLOAT64X_LONG_DOUBLE
178178# define __CFLOAT64X _Complex long double
179179# else
......@@ -185,7 +185,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
185185# endif
186186
187187# if __HAVE_FLOAT128X
188# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
188# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
189189# error "_Float128X supported but no complex type"
190190# else
191191# define __CFLOAT128X _Complex _Float128x
......@@ -195,7 +195,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
195195/* The remaining of this file provides support for older compilers. */
196196# if __HAVE_FLOAT16
197197
198# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
198# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
199199typedef float _Float16 __attribute__ ((__mode__ (__HF__)));
200200# endif
201201
......@@ -210,7 +210,7 @@ typedef float _Float16 __attribute__ ((__mode__ (__HF__)));
210210
211211# if __HAVE_FLOAT32
212212
213# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
213# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
214214typedef float _Float32;
215215# endif
216216
......@@ -234,7 +234,7 @@ typedef float _Float32;
234234
235235# ifdef __NO_LONG_DOUBLE_MATH
236236
237# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
237# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
238238typedef long double _Float64;
239239# endif
240240
......@@ -247,7 +247,7 @@ typedef long double _Float64;
247247
248248# else
249249
250# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
250# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
251251typedef double _Float64;
252252# endif
253253
......@@ -264,7 +264,7 @@ typedef double _Float64;
264264
265265# if __HAVE_FLOAT32X
266266
267# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
267# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
268268typedef double _Float32x;
269269# endif
270270
......@@ -281,7 +281,7 @@ typedef double _Float32x;
281281
282282# if __HAVE_FLOAT64X_LONG_DOUBLE
283283
284# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
284# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
285285typedef long double _Float64x;
286286# endif
287287
......@@ -294,7 +294,7 @@ typedef long double _Float64x;
294294
295295# else
296296
297# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
297# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
298298typedef _Float128 _Float64x;
299299# endif
300300
......@@ -311,7 +311,7 @@ typedef _Float128 _Float64x;
311311
312312# if __HAVE_FLOAT128X
313313
314# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
314# if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
315315# error "_Float128x supported but no type"
316316# endif
317317
lib/libc/glibc/bits/libc-header-start.h+1-1
......@@ -1,5 +1,5 @@
11/* Handle feature test macros at the start of a header.
2 Copyright (C) 2016-2021 Free Software Foundation, Inc.
2 Copyright (C) 2016-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/long-double.h+1-1
......@@ -1,5 +1,5 @@
11/* Properties of long double type.
2 Copyright (C) 2016-2021 Free Software Foundation, Inc.
2 Copyright (C) 2016-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/select.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/signum-generic.h+1-1
......@@ -1,5 +1,5 @@
11/* Signal number constants. Generic template.
2 Copyright (C) 1991-2021 Free Software Foundation, Inc.
2 Copyright (C) 1991-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/stat.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/stdint-intn.h+1-1
......@@ -1,5 +1,5 @@
11/* Define intN_t types.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/stdlib-bsearch.h+12-3
......@@ -1,5 +1,5 @@
11/* Perform binary search - inline version.
2 Copyright (C) 1991-2021 Free Software Foundation, Inc.
2 Copyright (C) 1991-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -29,14 +29,23 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
2929 while (__l < __u)
3030 {
3131 __idx = (__l + __u) / 2;
32 __p = (void *) (((const char *) __base) + (__idx * __size));
32 __p = (const void *) (((const char *) __base) + (__idx * __size));
3333 __comparison = (*__compar) (__key, __p);
3434 if (__comparison < 0)
3535 __u = __idx;
3636 else if (__comparison > 0)
3737 __l = __idx + 1;
3838 else
39 return (void *) __p;
39 {
40#if __GNUC_PREREQ(4, 6)
41# pragma GCC diagnostic push
42# pragma GCC diagnostic ignored "-Wcast-qual"
43#endif
44 return (void *) __p;
45#if __GNUC_PREREQ(4, 6)
46# pragma GCC diagnostic pop
47#endif
48 }
4049 }
4150
4251 return NULL;
lib/libc/glibc/bits/time64.h+1-1
......@@ -1,5 +1,5 @@
11/* bits/time64.h -- underlying types for __time64_t. Generic version.
2 Copyright (C) 2018-2021 Free Software Foundation, Inc.
2 Copyright (C) 2018-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/timesize.h+2-4
......@@ -1,5 +1,5 @@
11/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2021 Free Software Foundation, Inc.
2 Copyright (C) 2018-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -16,7 +16,5 @@
1616 License along with the GNU C Library; if not, see
1717 <https://www.gnu.org/licenses/>. */
1818
19#include <bits/wordsize.h>
20
2119/* Size in bits of the 'time_t' type of the default ABI. */
22#define __TIMESIZE __WORDSIZE
20#define __TIMESIZE 64
lib/libc/glibc/bits/types/struct_sched_param.h+1-1
......@@ -1,5 +1,5 @@
11/* Sched parameter structure. Generic version.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/typesizes.h+1-1
......@@ -1,5 +1,5 @@
11/* bits/typesizes.h -- underlying types for *_t. Generic version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/uintn-identity.h+1-1
......@@ -1,5 +1,5 @@
11/* Inline functions to return unsigned integer values unchanged.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/waitflags.h+1-1
......@@ -1,5 +1,5 @@
11/* Definitions of flag bits for `waitpid' et al.
2 Copyright (C) 1992-2021 Free Software Foundation, Inc.
2 Copyright (C) 1992-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/waitstatus.h+1-1
......@@ -1,5 +1,5 @@
11/* Definitions of status bits for `wait' et al.
2 Copyright (C) 1992-2021 Free Software Foundation, Inc.
2 Copyright (C) 1992-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/csu/errno.c+1-1
......@@ -1,5 +1,5 @@
11/* Definition of `errno' variable. Canonical version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/debug/stack_chk_fail_local.c+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2005-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2005-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/elf/elf.h+248-19
......@@ -1,5 +1,5 @@
11/* This file defines standard ELF types, structures, and macros.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -210,7 +210,7 @@ typedef struct
210210#define EM_68HC12 53 /* Motorola M68HC12 */
211211#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */
212212#define EM_PCP 55 /* Siemens PCP */
213#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
213#define EM_NCPU 56 /* Sony nCPU embedded RISC */
214214#define EM_NDR1 57 /* Denso NDR1 microprocessor */
215215#define EM_STARCORE 58 /* Motorola Start*Core processor */
216216#define EM_ME16 59 /* Toyota ME16 processor */
......@@ -358,8 +358,9 @@ typedef struct
358358
359359#define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */
360360#define EM_CSKY 252 /* C-SKY */
361#define EM_LOONGARCH 258 /* LoongArch */
361362
362#define EM_NUM 253
363#define EM_NUM 259
363364
364365/* Old spellings/synonyms. */
365366
......@@ -443,7 +444,8 @@ typedef struct
443444#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
444445#define SHT_GROUP 17 /* Section group */
445446#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */
446#define SHT_NUM 19 /* Number of defined types. */
447#define SHT_RELR 19 /* RELR relative relocations */
448#define SHT_NUM 20 /* Number of defined types. */
447449#define SHT_LOOS 0x60000000 /* Start OS-specific. */
448450#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */
449451#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */
......@@ -504,6 +506,7 @@ typedef struct
504506
505507/* Legal values for ch_type (compression algorithm). */
506508#define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE algorithm. */
509#define ELFCOMPRESS_ZSTD 2 /* Zstandard algorithm. */
507510#define ELFCOMPRESS_LOOS 0x60000000 /* Start of OS-specific. */
508511#define ELFCOMPRESS_HIOS 0x6fffffff /* End of OS-specific. */
509512#define ELFCOMPRESS_LOPROC 0x70000000 /* Start of processor-specific. */
......@@ -556,7 +559,7 @@ typedef struct
556559
557560/* Possible bitmasks for si_flags. */
558561#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */
559#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */
562#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-through symbol for translator */
560563#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */
561564#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy
562565 loaded */
......@@ -662,6 +665,11 @@ typedef struct
662665 Elf64_Sxword r_addend; /* Addend */
663666} Elf64_Rela;
664667
668/* RELR relocation table entry */
669
670typedef Elf32_Word Elf32_Relr;
671typedef Elf64_Xword Elf64_Relr;
672
665673/* How to extract and insert information held in the r_info field. */
666674
667675#define ELF32_R_SYM(val) ((val) >> 8)
......@@ -720,6 +728,7 @@ typedef struct
720728#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
721729#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
722730#define PT_GNU_PROPERTY 0x6474e553 /* GNU property */
731#define PT_GNU_SFRAME 0x6474e554 /* SFrame segment. */
723732#define PT_LOSUNW 0x6ffffffa
724733#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
725734#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
......@@ -801,6 +810,7 @@ typedef struct
801810#define NT_S390_GS_BC 0x30c /* s390 guarded storage
802811 broadcast control block. */
803812#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation. */
813#define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data. */
804814#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
805815#define NT_ARM_TLS 0x401 /* ARM TLS register */
806816#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
......@@ -822,6 +832,15 @@ typedef struct
822832#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
823833#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
824834#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */
835#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */
836#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and
837 status registers. */
838#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD
839 Extension registers. */
840#define NT_LOONGARCH_LASX 0xa03 /* LoongArch Loongson Advanced
841 SIMD Extension registers. */
842#define NT_LOONGARCH_LBT 0xa04 /* LoongArch Loongson Binary
843 Translation registers. */
825844
826845/* Legal values for the note segment descriptor types for object files. */
827846
......@@ -887,7 +906,10 @@ typedef struct
887906#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
888907#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
889908#define DT_SYMTAB_SHNDX 34 /* Address of SYMTAB_SHNDX section */
890#define DT_NUM 35 /* Number used */
909#define DT_RELRSZ 35 /* Total size of RELR relative relocations */
910#define DT_RELR 36 /* Address of RELR relative relocations */
911#define DT_RELRENT 37 /* Size of one RELR relative relocaction */
912#define DT_NUM 38 /* Number used */
891913#define DT_LOOS 0x6000000d /* Start of OS-specific */
892914#define DT_HIOS 0x6ffff000 /* End of OS-specific */
893915#define DT_LOPROC 0x70000000 /* Start of processor-specific */
......@@ -1044,7 +1066,8 @@ typedef struct
10441066
10451067/* Legal values for vd_flags (version information flags). */
10461068#define VER_FLG_BASE 0x1 /* Version definition of file itself */
1047#define VER_FLG_WEAK 0x2 /* Weak version identifier */
1069#define VER_FLG_WEAK 0x2 /* Weak version identifier. Also
1070 used by vna_flags below. */
10481071
10491072/* Versym symbol index values. */
10501073#define VER_NDX_LOCAL 0 /* Symbol is local. */
......@@ -1122,10 +1145,6 @@ typedef struct
11221145} Elf64_Vernaux;
11231146
11241147
1125/* Legal values for vna_flags. */
1126#define VER_FLG_WEAK 0x2 /* Weak version identifier */
1127
1128
11291148/* Auxiliary vector. */
11301149
11311150/* This vector is normally only used by the program interpreter. The
......@@ -1205,6 +1224,9 @@ typedef struct
12051224#define AT_HWCAP2 26 /* More machine-dependent hints about
12061225 processor capabilities. */
12071226
1227#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size. */
1228#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment. */
1229
12081230#define AT_EXECFN 31 /* Filename of executable. */
12091231
12101232/* Pointer to the global system page used for system calls and other
......@@ -1231,8 +1253,7 @@ typedef struct
12311253#define AT_L3_CACHESIZE 46
12321254#define AT_L3_CACHEGEOMETRY 47
12331255
1234#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery
1235 (AArch64). */
1256#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery */
12361257
12371258/* Note section contents. Each entry in the note section begins with
12381259 a header of a fixed form. */
......@@ -1259,6 +1280,8 @@ typedef struct
12591280/* Note entries for GNU systems have this name. */
12601281#define ELF_NOTE_GNU "GNU"
12611282
1283/* Note entries for freedesktop.org have this name. */
1284#define ELF_NOTE_FDO "FDO"
12621285
12631286/* Defined types of notes for Solaris. */
12641287
......@@ -1302,6 +1325,10 @@ typedef struct
13021325/* Program property. */
13031326#define NT_GNU_PROPERTY_TYPE_0 5
13041327
1328/* Packaging metadata as defined on
1329 https://systemd.io/COREDUMP_PACKAGE_METADATA/ */
1330#define NT_FDO_PACKAGING_METADATA 0xcafe1a7e
1331
13051332/* Note section name of program property. */
13061333#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
13071334
......@@ -1312,6 +1339,23 @@ typedef struct
13121339/* No copy relocation on protected data symbol. */
13131340#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2
13141341
1342/* A 4-byte unsigned integer property: A bit is set if it is set in all
1343 relocatable inputs. */
1344#define GNU_PROPERTY_UINT32_AND_LO 0xb0000000
1345#define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff
1346
1347/* A 4-byte unsigned integer property: A bit is set if it is set in any
1348 relocatable inputs. */
1349#define GNU_PROPERTY_UINT32_OR_LO 0xb0008000
1350#define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff
1351
1352/* The needed properties by the object file. */
1353#define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO
1354
1355/* Set if the object file requires canonical function pointers and
1356 cannot be used with copy relocation. */
1357#define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS (1U << 0)
1358
13151359/* Processor-specific semantics, lo */
13161360#define GNU_PROPERTY_LOPROC 0xc0000000
13171361/* Processor-specific semantics, hi */
......@@ -2871,6 +2915,9 @@ enum
28712915#define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */
28722916#define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */
28732917
2918/* MTE memory tag segment type. */
2919#define PT_AARCH64_MEMTAG_MTE (PT_LOPROC + 2)
2920
28742921/* AArch64 specific values for the Dyn d_tag field. */
28752922#define DT_AARCH64_BTI_PLT (DT_LOPROC + 1)
28762923#define DT_AARCH64_PAC_PLT (DT_LOPROC + 3)
......@@ -3896,6 +3943,8 @@ enum
38963943#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
38973944#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
38983945#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
3946#define EF_RISCV_RVE 0x0008
3947#define EF_RISCV_TSO 0x0010
38993948
39003949/* RISC-V relocations. */
39013950#define R_RISCV_NONE 0
......@@ -3953,8 +4002,24 @@ enum
39534002#define R_RISCV_SET32 56
39544003#define R_RISCV_32_PCREL 57
39554004#define R_RISCV_IRELATIVE 58
4005#define R_RISCV_PLT32 59
4006#define R_RISCV_SET_ULEB128 60
4007#define R_RISCV_SUB_ULEB128 61
39564008
3957#define R_RISCV_NUM 59
4009#define R_RISCV_NUM 62
4010
4011/* RISC-V specific values for the st_other field. */
4012#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling
4013 convention */
4014
4015/* RISC-V specific values for the sh_type field. */
4016#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3)
4017
4018/* RISC-V specific values for the p_type field. */
4019#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3)
4020
4021/* RISC-V specific values for the d_tag field. */
4022#define DT_RISCV_VARIANT_CC (DT_LOPROC + 1)
39584023
39594024/* BPF specific declarations. */
39604025
......@@ -4034,13 +4099,130 @@ enum
40344099#define R_NDS32_TLS_TPOFF 102
40354100#define R_NDS32_TLS_DESC 119
40364101
4102/* LoongArch ELF Flags */
4103#define EF_LARCH_ABI_MODIFIER_MASK 0x07
4104#define EF_LARCH_ABI_SOFT_FLOAT 0x01
4105#define EF_LARCH_ABI_SINGLE_FLOAT 0x02
4106#define EF_LARCH_ABI_DOUBLE_FLOAT 0x03
4107#define EF_LARCH_OBJABI_V1 0x40
4108
4109/* LoongArch specific dynamic relocations */
4110#define R_LARCH_NONE 0
4111#define R_LARCH_32 1
4112#define R_LARCH_64 2
4113#define R_LARCH_RELATIVE 3
4114#define R_LARCH_COPY 4
4115#define R_LARCH_JUMP_SLOT 5
4116#define R_LARCH_TLS_DTPMOD32 6
4117#define R_LARCH_TLS_DTPMOD64 7
4118#define R_LARCH_TLS_DTPREL32 8
4119#define R_LARCH_TLS_DTPREL64 9
4120#define R_LARCH_TLS_TPREL32 10
4121#define R_LARCH_TLS_TPREL64 11
4122#define R_LARCH_IRELATIVE 12
4123
4124/* Reserved for future relocs that the dynamic linker must understand. */
4125
4126/* used by the static linker for relocating .text. */
4127#define R_LARCH_MARK_LA 20
4128#define R_LARCH_MARK_PCREL 21
4129#define R_LARCH_SOP_PUSH_PCREL 22
4130#define R_LARCH_SOP_PUSH_ABSOLUTE 23
4131#define R_LARCH_SOP_PUSH_DUP 24
4132#define R_LARCH_SOP_PUSH_GPREL 25
4133#define R_LARCH_SOP_PUSH_TLS_TPREL 26
4134#define R_LARCH_SOP_PUSH_TLS_GOT 27
4135#define R_LARCH_SOP_PUSH_TLS_GD 28
4136#define R_LARCH_SOP_PUSH_PLT_PCREL 29
4137#define R_LARCH_SOP_ASSERT 30
4138#define R_LARCH_SOP_NOT 31
4139#define R_LARCH_SOP_SUB 32
4140#define R_LARCH_SOP_SL 33
4141#define R_LARCH_SOP_SR 34
4142#define R_LARCH_SOP_ADD 35
4143#define R_LARCH_SOP_AND 36
4144#define R_LARCH_SOP_IF_ELSE 37
4145#define R_LARCH_SOP_POP_32_S_10_5 38
4146#define R_LARCH_SOP_POP_32_U_10_12 39
4147#define R_LARCH_SOP_POP_32_S_10_12 40
4148#define R_LARCH_SOP_POP_32_S_10_16 41
4149#define R_LARCH_SOP_POP_32_S_10_16_S2 42
4150#define R_LARCH_SOP_POP_32_S_5_20 43
4151#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44
4152#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45
4153#define R_LARCH_SOP_POP_32_U 46
4154
4155/* used by the static linker for relocating non .text. */
4156#define R_LARCH_ADD8 47
4157#define R_LARCH_ADD16 48
4158#define R_LARCH_ADD24 49
4159#define R_LARCH_ADD32 50
4160#define R_LARCH_ADD64 51
4161#define R_LARCH_SUB8 52
4162#define R_LARCH_SUB16 53
4163#define R_LARCH_SUB24 54
4164#define R_LARCH_SUB32 55
4165#define R_LARCH_SUB64 56
4166#define R_LARCH_GNU_VTINHERIT 57
4167#define R_LARCH_GNU_VTENTRY 58
4168
4169/* reserved 59-63 */
4170
4171#define R_LARCH_B16 64
4172#define R_LARCH_B21 65
4173#define R_LARCH_B26 66
4174#define R_LARCH_ABS_HI20 67
4175#define R_LARCH_ABS_LO12 68
4176#define R_LARCH_ABS64_LO20 69
4177#define R_LARCH_ABS64_HI12 70
4178#define R_LARCH_PCALA_HI20 71
4179#define R_LARCH_PCALA_LO12 72
4180#define R_LARCH_PCALA64_LO20 73
4181#define R_LARCH_PCALA64_HI12 74
4182#define R_LARCH_GOT_PC_HI20 75
4183#define R_LARCH_GOT_PC_LO12 76
4184#define R_LARCH_GOT64_PC_LO20 77
4185#define R_LARCH_GOT64_PC_HI12 78
4186#define R_LARCH_GOT_HI20 79
4187#define R_LARCH_GOT_LO12 80
4188#define R_LARCH_GOT64_LO20 81
4189#define R_LARCH_GOT64_HI12 82
4190#define R_LARCH_TLS_LE_HI20 83
4191#define R_LARCH_TLS_LE_LO12 84
4192#define R_LARCH_TLS_LE64_LO20 85
4193#define R_LARCH_TLS_LE64_HI12 86
4194#define R_LARCH_TLS_IE_PC_HI20 87
4195#define R_LARCH_TLS_IE_PC_LO12 88
4196#define R_LARCH_TLS_IE64_PC_LO20 89
4197#define R_LARCH_TLS_IE64_PC_HI12 90
4198#define R_LARCH_TLS_IE_HI20 91
4199#define R_LARCH_TLS_IE_LO12 92
4200#define R_LARCH_TLS_IE64_LO20 93
4201#define R_LARCH_TLS_IE64_HI12 94
4202#define R_LARCH_TLS_LD_PC_HI20 95
4203#define R_LARCH_TLS_LD_HI20 96
4204#define R_LARCH_TLS_GD_PC_HI20 97
4205#define R_LARCH_TLS_GD_HI20 98
4206#define R_LARCH_32_PCREL 99
4207#define R_LARCH_RELAX 100
4208
4209/* ARC specific declarations. */
4210
4211/* Processor specific flags for the Ehdr e_flags field. */
4212#define EF_ARC_MACH_MSK 0x000000ff
4213#define EF_ARC_OSABI_MSK 0x00000f00
4214#define EF_ARC_ALL_MSK (EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK)
4215
4216/* Processor specific values for the Shdr sh_type field. */
4217#define SHT_ARC_ATTRIBUTES (SHT_LOPROC + 1) /* ARC attributes section. */
4218
40374219/* ARCompact/ARCv2 specific relocs. */
40384220#define R_ARC_NONE 0x0
40394221#define R_ARC_8 0x1
40404222#define R_ARC_16 0x2
40414223#define R_ARC_24 0x3
40424224#define R_ARC_32 0x4
4043#define R_ARC_B26 0x5
4225
40444226#define R_ARC_B22_PCREL 0x6
40454227#define R_ARC_H30 0x7
40464228#define R_ARC_N8 0x8
......@@ -4080,16 +4262,23 @@ enum
40804262#define R_ARC_SECTOFF_ME_2 0x2A
40814263#define R_ARC_SECTOFF_1 0x2B
40824264#define R_ARC_SECTOFF_2 0x2C
4265#define R_ARC_SDA_12 0x2D
4266#define R_ARC_SDA16_ST2 0x30
4267#define R_ARC_32_PCREL 0x31
40834268#define R_ARC_PC32 0x32
40844269#define R_ARC_GOTPC32 0x33
40854270#define R_ARC_PLT32 0x34
40864271#define R_ARC_COPY 0x35
40874272#define R_ARC_GLOB_DAT 0x36
4088#define R_ARC_JUMP_SLOT 0x37
4273#define R_ARC_JMP_SLOT 0x37
40894274#define R_ARC_RELATIVE 0x38
40904275#define R_ARC_GOTOFF 0x39
40914276#define R_ARC_GOTPC 0x3A
40924277#define R_ARC_GOT32 0x3B
4278#define R_ARC_S21W_PCREL_PLT 0x3C
4279#define R_ARC_S25H_PCREL_PLT 0x3D
4280
4281#define R_ARC_JLI_SECTOFF 0x3F
40934282
40944283#define R_ARC_TLS_DTPMOD 0x42
40954284#define R_ARC_TLS_DTPOFF 0x43
......@@ -4098,8 +4287,48 @@ enum
40984287#define R_ARC_TLS_GD_LD 0x46
40994288#define R_ARC_TLS_GD_CALL 0x47
41004289#define R_ARC_TLS_IE_GOT 0x48
4101#define R_ARC_TLS_DTPOFF_S9 0x4a
4102#define R_ARC_TLS_LE_S9 0x4a
4103#define R_ARC_TLS_LE_32 0x4b
4290#define R_ARC_TLS_DTPOFF_S9 0x49
4291#define R_ARC_TLS_LE_S9 0x4A
4292#define R_ARC_TLS_LE_32 0x4B
4293#define R_ARC_S25W_PCREL_PLT 0x4C
4294#define R_ARC_S21H_PCREL_PLT 0x4D
4295#define R_ARC_NPS_CMEM16 0x4E
4296
4297/* OpenRISC 1000 specific relocs. */
4298#define R_OR1K_NONE 0
4299#define R_OR1K_32 1
4300#define R_OR1K_16 2
4301#define R_OR1K_8 3
4302#define R_OR1K_LO_16_IN_INSN 4
4303#define R_OR1K_HI_16_IN_INSN 5
4304#define R_OR1K_INSN_REL_26 6
4305#define R_OR1K_GNU_VTENTRY 7
4306#define R_OR1K_GNU_VTINHERIT 8
4307#define R_OR1K_32_PCREL 9
4308#define R_OR1K_16_PCREL 10
4309#define R_OR1K_8_PCREL 11
4310#define R_OR1K_GOTPC_HI16 12
4311#define R_OR1K_GOTPC_LO16 13
4312#define R_OR1K_GOT16 14
4313#define R_OR1K_PLT26 15
4314#define R_OR1K_GOTOFF_HI16 16
4315#define R_OR1K_GOTOFF_LO16 17
4316#define R_OR1K_COPY 18
4317#define R_OR1K_GLOB_DAT 19
4318#define R_OR1K_JMP_SLOT 20
4319#define R_OR1K_RELATIVE 21
4320#define R_OR1K_TLS_GD_HI16 22
4321#define R_OR1K_TLS_GD_LO16 23
4322#define R_OR1K_TLS_LDM_HI16 24
4323#define R_OR1K_TLS_LDM_LO16 25
4324#define R_OR1K_TLS_LDO_HI16 26
4325#define R_OR1K_TLS_LDO_LO16 27
4326#define R_OR1K_TLS_IE_HI16 28
4327#define R_OR1K_TLS_IE_LO16 29
4328#define R_OR1K_TLS_LE_HI16 30
4329#define R_OR1K_TLS_LE_LO16 31
4330#define R_OR1K_TLS_TPOFF 32
4331#define R_OR1K_TLS_DTPOFF 33
4332#define R_OR1K_TLS_DTPMOD 34
41044333
41054334#endif /* elf.h */
lib/libc/glibc/include/libc-pointer-arith.h+9-1
......@@ -1,5 +1,5 @@
11/* Helper macros for pointer arithmetic.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -60,4 +60,12 @@
6060#define PTR_ALIGN_UP(base, size) \
6161 ((__typeof__ (base)) ALIGN_UP ((uintptr_t) (base), (size)))
6262
63/* Check if BASE is aligned on SIZE */
64#define PTR_IS_ALIGNED(base, size) \
65 ((((uintptr_t) (base)) & (size - 1)) == 0)
66
67/* Returns the ptrdiff_t difference between P1 and P2. */
68#define PTR_DIFF(p1, p2) \
69 ((ptrdiff_t)((uintptr_t)(p1) - (uintptr_t)(p2)))
70
6371#endif
lib/libc/glibc/include/libc-symbols.h+41-253
......@@ -1,6 +1,6 @@
11/* Support macros for making weak and strong aliases for symbols,
22 and for using symbol sets and linker warnings with GNU ld.
3 Copyright (C) 1995-2021 Free Software Foundation, Inc.
3 Copyright (C) 1995-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -155,14 +155,6 @@
155155 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \
156156 __attribute_copy__ (name);
157157
158/* Same as WEAK_ALIAS, but mark symbol as hidden. */
159# define weak_hidden_alias(name, aliasname) \
160 _weak_hidden_alias (name, aliasname)
161# define _weak_hidden_alias(name, aliasname) \
162 extern __typeof (name) aliasname \
163 __attribute__ ((weak, alias (#name), __visibility__ ("hidden"))) \
164 __attribute_copy__ (name);
165
166158/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
167159# define weak_extern(symbol) _weak_extern (weak symbol)
168160# define _weak_extern(expr) _Pragma (#expr)
......@@ -245,105 +237,32 @@ requires at runtime the shared libraries from the glibc version used \
245237for linking")
246238#endif
247239
248/* Resource Freeing Hooks:
249
250 Normally a process exits and the OS cleans up any allocated
251 memory. However, when tooling like mtrace or valgrind is monitoring
252 the process we need to free all resources that are part of the
253 process in order to provide the consistency required to track
254 memory leaks.
255
256 A single public API exists and is __libc_freeres(), and this is used
257 by applications like valgrind to freee resouces.
258
259 There are 3 cases:
260
261 (a) __libc_freeres
262
263 In this case all you need to do is define the freeing routine:
264
265 foo.c:
266 libfoo_freeres_fn (foo_freeres)
267 {
268 complex_free (mem);
269 }
270
271 This ensures the function is called at the right point to free
272 resources.
273
274 (b) __libc_freeres_ptr
275
276 The framework for (a) iterates over the list of pointers-to-free
277 in (b) and frees them.
278
279 foo.c:
280 libc_freeres_ptr (static char *foo_buffer);
281
282 Freeing these resources alaways happens last and is equivalent
283 to registering a function that does 'free (foo_buffer)'.
284
285 (c) Explicit lists of free routines to call or objects to free.
286
287 It is the intended goal to remove (a) and (b) which have some
288 non-determinism based on link order, and instead use explicit
289 lists of functions and frees to resolve cleanup ordering issues
290 and make it easy to debug and maintain.
291
292 As of today the following subsystems use (c):
293
294 Per-thread cleanup:
295 * malloc/thread-freeres.c
296
297 libdl cleanup:
298 * dlfcn/dlfreeres.c
299
300 libpthread cleanup:
301 * nptl/nptlfreeres.c
302
303 So if you need any shutdown routines to run you should add them
304 directly to the appropriate subsystem's shutdown list. */
305
306/* Resource pointers to free in libc.so. */
307#define libc_freeres_ptr(decl) \
308 __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") \
309 decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment)))
310
311/* Resource freeing functions from libc.so go in this section. */
312#define __libc_freeres_fn_section \
313 __attribute__ ((__used__, section ("__libc_freeres_fn")))
314
315/* Resource freeing functions for libc.so. */
316#define libc_freeres_fn(name) \
317 static void name (void) __attribute_used__ __libc_freeres_fn_section; \
318 text_set_element (__libc_subfreeres, name); \
319 static void name (void)
320
321240/* Declare SYMBOL to be TYPE (`function' or `object') of SIZE bytes
322241 alias to ORIGINAL, when the assembler supports such declarations
323242 (such as in ELF).
324243 This is only necessary when defining something in assembly, or playing
325244 funny alias games where the size should be other than what the compiler
326245 thinks it is. */
327#define declare_symbol_alias(symbol, original, type, size) \
328 declare_symbol_alias_1 (symbol, original, type, size)
246#define declare_object_symbol_alias(symbol, original, size) \
247 declare_object_symbol_alias_1 (symbol, original, size)
329248#ifdef __ASSEMBLER__
330# define declare_symbol_alias_1(symbol, original, type, size) \
331 strong_alias (original, symbol); \
332 .type C_SYMBOL_NAME (symbol), %##type; \
333 .size C_SYMBOL_NAME (symbol), size
249# define declare_object_symbol_alias_1(symbol, original, s_size) \
250 strong_alias (original, symbol) ASM_LINE_SEP \
251 .type C_SYMBOL_NAME (symbol), %object ASM_LINE_SEP \
252 .size C_SYMBOL_NAME (symbol), s_size ASM_LINE_SEP
334253#else /* Not __ASSEMBLER__. */
335# define declare_symbol_alias_1(symbol, original, type, size) \
336 asm (".globl " __SYMBOL_PREFIX #symbol \
337 "\n\t" declare_symbol_alias_1_alias (symbol, original) \
338 "\n\t.type " __SYMBOL_PREFIX #symbol ", " \
339 "%" #type \
340 "\n\t.size " __SYMBOL_PREFIX #symbol ", " #size);
341254# ifdef HAVE_ASM_SET_DIRECTIVE
342# define declare_symbol_alias_1_alias(symbol, original) \
343 ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX #original
255# define declare_object_symbol_alias_1(symbol, original, size) \
256 asm (".global " __SYMBOL_PREFIX # symbol "\n" \
257 ".type " __SYMBOL_PREFIX # symbol ", %object\n" \
258 ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX original "\n" \
259 ".size " __SYMBOL_PREFIX #symbol ", " #size "\n");
344260# else
345# define declare_symbol_alias_1_alias(symbol, original) \
346 __SYMBOL_PREFIX #symbol " = " __SYMBOL_PREFIX #original
261# define declare_object_symbol_alias_1(symbol, original, size) \
262 asm (".global " __SYMBOL_PREFIX # symbol "\n" \
263 ".type " __SYMBOL_PREFIX # symbol ", %object\n" \
264 __SYMBOL_PREFIX #symbol " = " __SYMBOL_PREFIX original "\n" \
265 ".size " __SYMBOL_PREFIX #symbol ", " #size "\n");
347266# endif /* HAVE_ASM_SET_DIRECTIVE */
348267#endif /* __ASSEMBLER__ */
349268
......@@ -419,7 +338,7 @@ for linking")
419338 _set_symbol_version (real, #name "@@" #version)
420339# endif
421340
422/* Evalutes to a string literal for VERSION in LIB. */
341/* Evaluates to a string literal for VERSION in LIB. */
423342# define symbol_version_string(lib, version) \
424343 _symbol_version_stringify_1 (VERSION_##lib##_##version)
425344# define _symbol_version_stringify_1(arg) _symbol_version_stringify_2 (arg)
......@@ -532,11 +451,15 @@ for linking")
532451 __attribute__ ((visibility ("hidden"), ##attrs))
533452# define hidden_proto(name, attrs...) \
534453 __hidden_proto (name, , __GI_##name, ##attrs)
454# define hidden_proto_alias(name, alias, attrs...) \
455 __hidden_proto_alias (name, , alias, ##attrs)
535456# define hidden_tls_proto(name, attrs...) \
536457 __hidden_proto (name, __thread, __GI_##name, ##attrs)
537458# define __hidden_proto(name, thread, internal, attrs...) \
538459 extern thread __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
539460 __hidden_proto_hiddenattr (attrs);
461# define __hidden_proto_alias(name, thread, internal, attrs...) \
462 extern thread __typeof (name) internal __hidden_proto_hiddenattr (attrs);
540463# define __hidden_asmname(name) \
541464 __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
542465# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
......@@ -550,9 +473,11 @@ for linking")
550473 __attribute__((alias (__hidden_asmname (#local)))) \
551474 __attribute_copy__ (name)
552475# define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
553# define hidden_data_ver(local, name) hidden_ver(local, name)
554476# define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
477# define hidden_def_alias(name, internal) \
478 strong_alias (name, internal)
555479# define hidden_data_def(name) hidden_def(name)
480# define hidden_data_def_alias(name, alias) hidden_def_alias(name, alias)
556481# define hidden_tls_def(name) \
557482 __hidden_ver2 (__thread, __GI_##name, name, name);
558483# define hidden_weak(name) \
......@@ -579,12 +504,13 @@ for linking")
579504 hidden_proto doesn't make sense for assembly but the equivalent
580505 is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
581506# define hidden_def(name) strong_alias (name, __GI_##name)
507# define hidden_def_alias(name, alias) strong_alias (name, alias)
582508# define hidden_weak(name) hidden_def (name)
583509# define hidden_ver(local, name) strong_alias (local, __GI_##name)
584510# define hidden_data_def(name) strong_data_alias (name, __GI_##name)
511# define hidden_data_def_alias(name, alias) strong_data_alias (name, alias)
585512# define hidden_tls_def(name) hidden_data_def (name)
586513# define hidden_data_weak(name) hidden_data_def (name)
587# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
588514# define HIDDEN_JUMPTARGET(name) __GI_##name
589515# endif
590516#else
......@@ -596,12 +522,17 @@ for linking")
596522 __attribute__ ((visibility ("hidden"), ##attrs))
597523# define hidden_proto(name, attrs...) \
598524 __hidden_proto (name, , name, ##attrs)
525# define hidden_proto_alias(name, alias, attrs...) \
526 __hidden_proto_alias (name, , alias, ##attrs)
599527# define hidden_tls_proto(name, attrs...) \
600528 __hidden_proto (name, __thread, name, ##attrs)
601529# define __hidden_proto(name, thread, internal, attrs...) \
602530 extern thread __typeof (name) name __hidden_proto_hiddenattr (attrs);
531# define __hidden_proto_alias(name, thread, internal, attrs...) \
532 extern thread __typeof (name) internal __hidden_proto_hiddenattr (attrs);
603533# else
604534# define hidden_proto(name, attrs...)
535# define hidden_proto_alias(name, alias, attrs...)
605536# define hidden_tls_proto(name, attrs...)
606537# endif
607538# else
......@@ -609,256 +540,116 @@ for linking")
609540# endif /* Not __ASSEMBLER__ */
610541# define hidden_weak(name)
611542# define hidden_def(name)
543# define hidden_def_alias(name, alias)
612544# define hidden_ver(local, name)
613545# define hidden_data_weak(name)
614546# define hidden_data_def(name)
547# define hidden_data_def_alias(name, alias)
615548# define hidden_tls_def(name)
616# define hidden_data_ver(local, name)
617549# define hidden_nolink(name, lib, version)
618550#endif
619551
620552#if IS_IN (libc)
621553# define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
554# define libc_hidden_proto_alias(name, alias, attrs...) \
555 hidden_proto_alias (name, alias, ##attrs)
622556# define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
623557# define libc_hidden_def(name) hidden_def (name)
624558# define libc_hidden_weak(name) hidden_weak (name)
625559# define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version)
626560# define libc_hidden_ver(local, name) hidden_ver (local, name)
627561# define libc_hidden_data_def(name) hidden_data_def (name)
562# define libc_hidden_data_def_alias(name, alias) hidden_data_def_alias (name, alias)
628563# define libc_hidden_tls_def(name) hidden_tls_def (name)
629564# define libc_hidden_data_weak(name) hidden_data_weak (name)
630# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
631565#else
632566# define libc_hidden_proto(name, attrs...)
567# define libc_hidden_proto_alias(name, alias, attrs...)
633568# define libc_hidden_tls_proto(name, attrs...)
634569# define libc_hidden_def(name)
635570# define libc_hidden_weak(name)
636571# define libc_hidden_ver(local, name)
637572# define libc_hidden_data_def(name)
573# define libc_hidden_data_def_alias(name, alias)
638574# define libc_hidden_tls_def(name)
639575# define libc_hidden_data_weak(name)
640# define libc_hidden_data_ver(local, name)
641576#endif
642577
643578#if IS_IN (rtld)
644579# define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
645# define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
646580# define rtld_hidden_def(name) hidden_def (name)
647581# define rtld_hidden_weak(name) hidden_weak (name)
648# define rtld_hidden_ver(local, name) hidden_ver (local, name)
649582# define rtld_hidden_data_def(name) hidden_data_def (name)
650# define rtld_hidden_tls_def(name) hidden_tls_def (name)
651# define rtld_hidden_data_weak(name) hidden_data_weak (name)
652# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
653583#else
654584# define rtld_hidden_proto(name, attrs...)
655# define rtld_hidden_tls_proto(name, attrs...)
656585# define rtld_hidden_def(name)
657586# define rtld_hidden_weak(name)
658# define rtld_hidden_ver(local, name)
659587# define rtld_hidden_data_def(name)
660# define rtld_hidden_tls_def(name)
661# define rtld_hidden_data_weak(name)
662# define rtld_hidden_data_ver(local, name)
663588#endif
664589
665590#if IS_IN (libm)
666591# define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
667# define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
668592# define libm_hidden_def(name) hidden_def (name)
669593# define libm_hidden_weak(name) hidden_weak (name)
670594# define libm_hidden_ver(local, name) hidden_ver (local, name)
671# define libm_hidden_data_def(name) hidden_data_def (name)
672# define libm_hidden_tls_def(name) hidden_tls_def (name)
673# define libm_hidden_data_weak(name) hidden_data_weak (name)
674# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
675595#else
676596# define libm_hidden_proto(name, attrs...)
677# define libm_hidden_tls_proto(name, attrs...)
678597# define libm_hidden_def(name)
679598# define libm_hidden_weak(name)
680599# define libm_hidden_ver(local, name)
681# define libm_hidden_data_def(name)
682# define libm_hidden_tls_def(name)
683# define libm_hidden_data_weak(name)
684# define libm_hidden_data_ver(local, name)
685600#endif
686601
687602#if IS_IN (libmvec)
688# define libmvec_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
689# define libmvec_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
690603# define libmvec_hidden_def(name) hidden_def (name)
691# define libmvec_hidden_weak(name) hidden_weak (name)
692# define libmvec_hidden_ver(local, name) hidden_ver (local, name)
693# define libmvec_hidden_data_def(name) hidden_data_def (name)
694# define libmvec_hidden_tls_def(name) hidden_tls_def (name)
695# define libmvec_hidden_data_weak(name) hidden_data_weak (name)
696# define libmvec_hidden_data_ver(local, name) hidden_data_ver (local, name)
697604#else
698# define libmvec_hidden_proto(name, attrs...)
699# define libmvec_hidden_tls_proto(name, attrs...)
700605# define libmvec_hidden_def(name)
701# define libmvec_hidden_weak(name)
702# define libmvec_hidden_ver(local, name)
703# define libmvec_hidden_data_def(name)
704# define libmvec_hidden_tls_def(name)
705# define libmvec_hidden_data_weak(name)
706# define libmvec_hidden_data_ver(local, name)
707606#endif
708607
709608#if IS_IN (libresolv)
710609# define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
711# define libresolv_hidden_tls_proto(name, attrs...) \
712 hidden_tls_proto (name, ##attrs)
713610# define libresolv_hidden_def(name) hidden_def (name)
714# define libresolv_hidden_weak(name) hidden_weak (name)
715# define libresolv_hidden_ver(local, name) hidden_ver (local, name)
716611# define libresolv_hidden_data_def(name) hidden_data_def (name)
717# define libresolv_hidden_tls_def(name) hidden_tls_def (name)
718# define libresolv_hidden_data_weak(name) hidden_data_weak (name)
719# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
720612#else
721613# define libresolv_hidden_proto(name, attrs...)
722# define libresolv_hidden_tls_proto(name, attrs...)
723614# define libresolv_hidden_def(name)
724# define libresolv_hidden_weak(name)
725# define libresolv_hidden_ver(local, name)
726615# define libresolv_hidden_data_def(name)
727# define libresolv_hidden_tls_def(name)
728# define libresolv_hidden_data_weak(name)
729# define libresolv_hidden_data_ver(local, name)
730616#endif
731617
732618#if IS_IN (libpthread)
733619# define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
734# define libpthread_hidden_tls_proto(name, attrs...) \
735 hidden_tls_proto (name, ##attrs)
736620# define libpthread_hidden_def(name) hidden_def (name)
737# define libpthread_hidden_weak(name) hidden_weak (name)
738# define libpthread_hidden_ver(local, name) hidden_ver (local, name)
739# define libpthread_hidden_data_def(name) hidden_data_def (name)
740# define libpthread_hidden_tls_def(name) hidden_tls_def (name)
741# define libpthread_hidden_data_weak(name) hidden_data_weak (name)
742# define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
743621#else
744622# define libpthread_hidden_proto(name, attrs...)
745# define libpthread_hidden_tls_proto(name, attrs...)
746623# define libpthread_hidden_def(name)
747# define libpthread_hidden_weak(name)
748# define libpthread_hidden_ver(local, name)
749# define libpthread_hidden_data_def(name)
750# define libpthread_hidden_tls_def(name)
751# define libpthread_hidden_data_weak(name)
752# define libpthread_hidden_data_ver(local, name)
753624#endif
754625
755626#if IS_IN (librt)
756627# define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
757# define librt_hidden_tls_proto(name, attrs...) \
758 hidden_tls_proto (name, ##attrs)
759# define librt_hidden_def(name) hidden_def (name)
760# define librt_hidden_weak(name) hidden_weak (name)
761628# define librt_hidden_ver(local, name) hidden_ver (local, name)
762# define librt_hidden_data_def(name) hidden_data_def (name)
763# define librt_hidden_tls_def(name) hidden_tls_def (name)
764# define librt_hidden_data_weak(name) hidden_data_weak (name)
765# define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
766629#else
767630# define librt_hidden_proto(name, attrs...)
768# define librt_hidden_tls_proto(name, attrs...)
769# define librt_hidden_def(name)
770# define librt_hidden_weak(name)
771631# define librt_hidden_ver(local, name)
772# define librt_hidden_data_def(name)
773# define librt_hidden_tls_def(name)
774# define librt_hidden_data_weak(name)
775# define librt_hidden_data_ver(local, name)
776#endif
777
778#if IS_IN (libdl)
779# define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
780# define libdl_hidden_tls_proto(name, attrs...) \
781 hidden_tls_proto (name, ##attrs)
782# define libdl_hidden_def(name) hidden_def (name)
783# define libdl_hidden_weak(name) hidden_weak (name)
784# define libdl_hidden_ver(local, name) hidden_ver (local, name)
785# define libdl_hidden_data_def(name) hidden_data_def (name)
786# define libdl_hidden_tls_def(name) hidden_tls_def (name)
787# define libdl_hidden_data_weak(name) hidden_data_weak (name)
788# define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
789#else
790# define libdl_hidden_proto(name, attrs...)
791# define libdl_hidden_tls_proto(name, attrs...)
792# define libdl_hidden_def(name)
793# define libdl_hidden_weak(name)
794# define libdl_hidden_ver(local, name)
795# define libdl_hidden_data_def(name)
796# define libdl_hidden_tls_def(name)
797# define libdl_hidden_data_weak(name)
798# define libdl_hidden_data_ver(local, name)
799632#endif
800633
801634#if IS_IN (libnsl)
802635# define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
803# define libnsl_hidden_tls_proto(name, attrs...) \
804 hidden_tls_proto (name, ##attrs)
805636# define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version)
806# define libnsl_hidden_weak(name) hidden_weak (name)
807# define libnsl_hidden_ver(local, name) hidden_ver (local, name)
808# define libnsl_hidden_data_def(name) hidden_data_def (name)
809# define libnsl_hidden_tls_def(name) hidden_tls_def (name)
810# define libnsl_hidden_data_weak(name) hidden_data_weak (name)
811# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
812637#else
813638# define libnsl_hidden_proto(name, attrs...)
814# define libnsl_hidden_tls_proto(name, attrs...)
815# define libnsl_hidden_weak(name)
816# define libnsl_hidden_ver(local, name)
817# define libnsl_hidden_data_def(name)
818# define libnsl_hidden_tls_def(name)
819# define libnsl_hidden_data_weak(name)
820# define libnsl_hidden_data_ver(local, name)
821639#endif
822640
823641#define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
824642#define libc_hidden_builtin_def(name) libc_hidden_def (name)
825#define libc_hidden_builtin_weak(name) libc_hidden_weak (name)
826#define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name)
827643
828644#define libc_hidden_ldbl_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
829645#ifdef __ASSEMBLER__
830646# define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
831647#endif
832648
833#if IS_IN (libutil)
834# define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
835# define libutil_hidden_tls_proto(name, attrs...) \
836 hidden_tls_proto (name, ##attrs)
837# define libutil_hidden_def(name) hidden_def (name)
838# define libutil_hidden_weak(name) hidden_weak (name)
839# define libutil_hidden_ver(local, name) hidden_ver (local, name)
840# define libutil_hidden_data_def(name) hidden_data_def (name)
841# define libutil_hidden_tls_def(name) hidden_tls_def (name)
842# define libutil_hidden_data_weak(name) hidden_data_weak (name)
843# define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
844#else
845# define libutil_hidden_proto(name, attrs...)
846# define libutil_hidden_tls_proto(name, attrs...)
847# define libutil_hidden_def(name)
848# define libutil_hidden_weak(name)
849# define libutil_hidden_ver(local, name)
850# define libutil_hidden_data_def(name)
851# define libutil_hidden_tls_def(name)
852# define libutil_hidden_data_weak(name)
853# define libutil_hidden_data_ver(local, name)
854#endif
855
856649#if IS_IN (libanl)
857650# define libanl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
858# define libanl_hidden_def(name) hidden_def (name)
859651#else
860652# define libanl_hidden_proto(name, attrs...)
861# define libanl_hidden_def(name)
862653#endif
863654
864655/* Get some dirty hacks. */
......@@ -869,11 +660,8 @@ for linking")
869660#ifndef __ASSEMBLER__
870661# define attribute_compat_text_section \
871662 __attribute__ ((section (".text.compat")))
872# define attribute_compat_data_section \
873 __attribute__ ((section (".data.compat")))
874663#else
875664# define compat_text_section .section ".text.compat", "ax";
876# define compat_data_section .section ".data.compat", "aw";
877665#endif
878666
879667/* Helper / base macros for indirect function symbols. */
......@@ -924,7 +712,7 @@ for linking")
924712
925713 If you have an implementation for foo which e.g. uses a special hardware
926714 feature which isn't available on all machines where this libc.so will be
927 used but decideable if available at runtime e.g. via hwcaps, you can provide
715 used but decidable if available at runtime e.g. via hwcaps, you can provide
928716 two or multiple implementations of foo:
929717
930718 int __foo_default (int __bar)
......@@ -977,7 +765,7 @@ for linking")
977765 : __foo_default);
978766
979767 This will define the ifunc'ed symbol foo like above. The redirection of foo
980 in header file is needed to omit an additional defintion of __GI_foo which
768 in header file is needed to omit an additional definition of __GI_foo which
981769 would end in a linker error while linking libc.so. You have to specify
982770 __redirect_foo as first parameter which is used within libc_ifunc_redirected
983771 macro in conjunction with typeof to define the ifunc'ed symbol foo.
lib/libc/glibc/include/signal.h+2-4
......@@ -14,10 +14,8 @@ libc_hidden_proto (__sigpause)
1414libc_hidden_proto (raise)
1515libc_hidden_proto (__libc_current_sigrtmin)
1616libc_hidden_proto (__libc_current_sigrtmax)
17extern const char * const __sys_siglist[_NSIG];
18libc_hidden_proto (__sys_siglist)
19extern const char * const __sys_sigabbrev[_NSIG];
20libc_hidden_proto (__sys_sigabbrev)
17extern const char * const __sys_siglist[_NSIG] attribute_hidden;
18extern const char * const __sys_sigabbrev[_NSIG] attribute_hidden;
2119
2220/* Now define the internal interfaces. */
2321extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler);
lib/libc/glibc/include/stap-probe.h+1-1
......@@ -1,5 +1,5 @@
11/* Macros for defining Systemtap <sys/sdt.h> static probe points.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/include/stdlib.h+53-2
......@@ -1,6 +1,7 @@
11#ifndef _STDLIB_H
22
33#ifndef _ISOMAC
4# include <stdbool.h>
45# include <stddef.h>
56#endif
67
......@@ -35,6 +36,45 @@ libc_hidden_proto (__strtod_l)
3536libc_hidden_proto (__strtof_l)
3637libc_hidden_proto (__strtold_l)
3738
39extern __typeof (strtol) __isoc23_strtol __attribute_copy__ (strtol);
40extern __typeof (strtoul) __isoc23_strtoul __attribute_copy__ (strtoul);
41extern __typeof (strtoll) __isoc23_strtoll __attribute_copy__ (strtoll);
42extern __typeof (strtoull) __isoc23_strtoull __attribute_copy__ (strtoull);
43extern __typeof (strtol_l) __isoc23_strtol_l __attribute_copy__ (strtol_l);
44extern __typeof (strtoul_l) __isoc23_strtoul_l __attribute_copy__ (strtoul_l);
45extern __typeof (strtoll_l) __isoc23_strtoll_l __attribute_copy__ (strtoll_l);
46extern __typeof (strtoull_l) __isoc23_strtoull_l __attribute_copy__ (strtoull_l);
47libc_hidden_proto (__isoc23_strtol)
48libc_hidden_proto (__isoc23_strtoul)
49libc_hidden_proto (__isoc23_strtoll)
50libc_hidden_proto (__isoc23_strtoull)
51libc_hidden_proto (__isoc23_strtol_l)
52libc_hidden_proto (__isoc23_strtoul_l)
53libc_hidden_proto (__isoc23_strtoll_l)
54libc_hidden_proto (__isoc23_strtoull_l)
55
56#if __GLIBC_USE (C2X_STRTOL)
57/* Redirect internal uses of these functions to the C2X versions; the
58 redirection in the installed header does not work with
59 libc_hidden_proto. */
60# undef strtol
61# define strtol __isoc23_strtol
62# undef strtoul
63# define strtoul __isoc23_strtoul
64# undef strtoll
65# define strtoll __isoc23_strtoll
66# undef strtoull
67# define strtoull __isoc23_strtoull
68# undef strtol_l
69# define strtol_l __isoc23_strtol_l
70# undef strtoul_l
71# define strtoul_l __isoc23_strtoul_l
72# undef strtoll_l
73# define strtoll_l __isoc23_strtoll_l
74# undef strtoull_l
75# define strtoull_l __isoc23_strtoull_l
76#endif
77
3878libc_hidden_proto (exit)
3979libc_hidden_proto (abort)
4080libc_hidden_proto (getenv)
......@@ -144,6 +184,15 @@ libc_hidden_proto (__ptsname_r)
144184libc_hidden_proto (grantpt)
145185libc_hidden_proto (unlockpt)
146186
187__typeof (arc4random) __arc4random;
188libc_hidden_proto (__arc4random);
189__typeof (arc4random_buf) __arc4random_buf;
190libc_hidden_proto (__arc4random_buf);
191__typeof (arc4random_uniform) __arc4random_uniform;
192libc_hidden_proto (__arc4random_uniform);
193extern void __arc4random_buf_internal (void *buffer, size_t len)
194 attribute_hidden;
195
147196extern double __strtod_internal (const char *__restrict __nptr,
148197 char **__restrict __endptr, int __group)
149198 __THROW __nonnull ((1)) __wur;
......@@ -193,23 +242,25 @@ extern long double ____strtold_l_internal (const char *__restrict __nptr,
193242extern long int ____strtol_l_internal (const char *__restrict __nptr,
194243 char **__restrict __endptr,
195244 int __base, int __group,
196 locale_t __loc);
245 bool __bin_cst, locale_t __loc);
197246extern unsigned long int ____strtoul_l_internal (const char *
198247 __restrict __nptr,
199248 char **__restrict __endptr,
200249 int __base, int __group,
250 bool __bin_cst,
201251 locale_t __loc);
202252__extension__
203253extern long long int ____strtoll_l_internal (const char *__restrict __nptr,
204254 char **__restrict __endptr,
205255 int __base, int __group,
206 locale_t __loc);
256 bool __bin_cst, locale_t __loc);
207257__extension__
208258extern unsigned long long int ____strtoull_l_internal (const char *
209259 __restrict __nptr,
210260 char **
211261 __restrict __endptr,
212262 int __base, int __group,
263 bool __bin_cst,
213264 locale_t __loc);
214265
215266libc_hidden_proto (____strtof_l_internal)
lib/libc/glibc/include/sys/cdefs.h+21
......@@ -1,5 +1,12 @@
11#ifndef _SYS_CDEFS_H
22
3/* This is outside of _ISOMAC to enforce that _Static_assert always
4 uses the two-argument form. This can be removed once the minimum
5 GCC version used to compile glibc is GCC 9.1. */
6#ifndef __cplusplus
7# define _Static_assert(expr, diagnostic) _Static_assert (expr, diagnostic)
8#endif
9
310#include <misc/sys/cdefs.h>
411
512#ifndef _ISOMAC
......@@ -33,6 +40,20 @@ rtld_hidden_proto (__chk_fail)
3340
3441#endif
3542
43#if defined SHARED
44#if IS_IN (libc) && __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
45
46#undef __REDIRECT_FORTIFY
47#define __REDIRECT_FORTIFY(name, proto, alias) \
48 __REDIRECT(name, proto, __GI_##alias)
49
50#undef __REDIRECT_FORTIFY_NTH
51#define __REDIRECT_FORTIFY_NTH(name, proto, alias) \
52 __REDIRECT_NTH(name, proto, __GI_##alias)
53
54#endif
55#endif /* defined SHARED */
56
3657#endif /* !defined _ISOMAC */
3758
3859#endif
lib/libc/glibc/include/sys/select.h+4
......@@ -3,6 +3,10 @@
33
44#ifndef _ISOMAC
55/* Now define the internal interfaces. */
6
7#include <bits/select-decl.h>
8libc_hidden_proto (__fdelt_chk)
9
610# if __TIMESIZE == 64
711# define __pselect64 __pselect
812# define __select64 __select
lib/libc/glibc/include/sys/stat.h+2
......@@ -66,10 +66,12 @@ hidden_proto (__fstatat64_time64);
6666extern int __chmod (const char *__file, __mode_t __mode);
6767libc_hidden_proto (__chmod)
6868extern int __fchmod (int __fd, __mode_t __mode);
69extern int __fchmodat (int __fd, const char *__file, mode_t __mode, int __flag);
6970libc_hidden_proto (fchmodat)
7071extern __mode_t __umask (__mode_t __mask);
7172extern int __mkdir (const char *__path, __mode_t __mode);
7273libc_hidden_proto (__mkdir)
74extern int __mkdirat (int __fd, const char *__path, mode_t __mode);
7375
7476extern int __mknodat (int fd, const char *path, mode_t mode, dev_t dev);
7577libc_hidden_proto (__mknodat);
lib/libc/glibc/io/bits/statx.h+1-1
......@@ -1,5 +1,5 @@
11/* statx-related definitions and declarations. Generic version.
2 Copyright (C) 2018-2021 Free Software Foundation, Inc.
2 Copyright (C) 2018-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/io/fcntl.h+5-12
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -167,10 +167,6 @@ typedef __pid_t pid_t;
167167 effective IDs, not real IDs. */
168168#endif
169169
170
171/* fcntl was a simple symbol until glibc 2.27 inclusive. glibc 2.28 onwards
172 * re-defines it to fcntl64 (via #define) if _FILE_OFFSET_BITS == 64. */
173#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2
174170/* Do the file control operation described by CMD on FD.
175171 The remaining arguments are interpreted depending on CMD.
176172
......@@ -191,19 +187,16 @@ extern int fcntl64 (int __fd, int __cmd, ...);
191187# endif
192188#else /* __USE_TIME_BITS64 */
193189# ifdef __REDIRECT
194extern int __REDIRECT (fcntl, (int __fd, int __request, ...),
195 __fcntl_time64) __THROW;
196extern int __REDIRECT (fcntl64, (int __fd, int __request, ...),
197 __fcntl_time64) __THROW;
190extern int __REDIRECT_NTH (fcntl, (int __fd, int __request, ...),
191 __fcntl_time64);
192extern int __REDIRECT_NTH (fcntl64, (int __fd, int __request, ...),
193 __fcntl_time64);
198194# else
199195extern int __fcntl_time64 (int __fd, int __request, ...) __THROW;
200196# define fcntl64 __fcntl_time64
201197# define fcntl __fcntl_time64
202198# endif
203199#endif
204#else /* glibc 2.27 or lower */
205extern int fcntl (int __fd, int __cmd, ...);
206#endif
207200
208201/* Open FILE and return a new file descriptor for it, or -1 on error.
209202 OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set
lib/libc/glibc/io/mknod.c+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/io/sys/stat.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/locale/bits/types/__locale_t.h+1-2
......@@ -1,7 +1,6 @@
11/* Definition of struct __locale_struct and __locale_t.
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 Copyright (C) 1997-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
54
65 The GNU C Library is free software; you can redistribute it and/or
76 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/locale/bits/types/locale_t.h+1-1
......@@ -1,5 +1,5 @@
11/* Definition of locale_t.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/misc/sys/cdefs.h+104-16
......@@ -1,4 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
2 Copyright The GNU Toolchain Authors.
23 This file is part of the GNU C Library.
34
45 The GNU C Library is free software; you can redistribute it and/or
......@@ -26,8 +27,8 @@
2627/* The GNU libc does not support any K&R compilers or the traditional mode
2728 of ISO C compilers anymore. Check for some of the combinations not
2829 supported anymore. */
29#if defined __GNUC__ && !defined __STDC__
30# error "You need a ISO C conforming compiler to use the glibc headers"
30#if defined __GNUC__ && !defined __STDC__ && !defined __cplusplus
31# error "You need a ISO C or C++ conforming compiler to use the glibc headers"
3132#endif
3233
3334/* Some user header file might have defined this before. */
......@@ -80,7 +81,7 @@
8081# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
8182# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
8283# else
83# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
84# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
8485# if __cplusplus >= 201103L
8586# define __THROW noexcept (true)
8687# else
......@@ -97,6 +98,12 @@
9798# endif
9899# endif
99100
101# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__)
102# define __COLD __attribute__ ((__cold__))
103# else
104# define __COLD
105# endif
106
100107#else /* Not GCC or clang. */
101108
102109# if (defined __cplusplus \
......@@ -109,6 +116,7 @@
109116# define __THROW
110117# define __THROWNL
111118# define __NTH(fct) fct
119# define __COLD
112120
113121#endif /* GCC || clang. */
114122
......@@ -142,7 +150,8 @@
142150#define __bos0(ptr) __builtin_object_size (ptr, 0)
143151
144152/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
145#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0)
153#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
154 || __GNUC_PREREQ (12, 0))
146155# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
147156# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
148157#else
......@@ -150,6 +159,55 @@
150159# define __glibc_objsize(__o) __bos (__o)
151160#endif
152161
162#if __USE_FORTIFY_LEVEL > 0
163/* Compile time conditions to choose between the regular, _chk and _chk_warn
164 variants. These conditions should get evaluated to constant and optimized
165 away. */
166
167#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
168#define __glibc_unsigned_or_positive(__l) \
169 ((__typeof (__l)) 0 < (__typeof (__l)) -1 \
170 || (__builtin_constant_p (__l) && (__l) > 0))
171
172/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
173 condition can be folded to a constant and if it is true, or unknown (-1) */
174#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
175 ((__builtin_constant_p (__osz) && (__osz) == (__SIZE_TYPE__) -1) \
176 || (__glibc_unsigned_or_positive (__l) \
177 && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
178 (__s), (__osz))) \
179 && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz))))
180
181/* Conversely, we know at compile time that the length is unsafe if the
182 __L * __S <= __OBJSZ condition can be folded to a constant and if it is
183 false. */
184#define __glibc_unsafe_len(__l, __s, __osz) \
185 (__glibc_unsigned_or_positive (__l) \
186 && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
187 __s, __osz)) \
188 && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
189
190/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
191 declared. */
192
193#define __glibc_fortify(f, __l, __s, __osz, ...) \
194 (__glibc_safe_or_unknown_len (__l, __s, __osz) \
195 ? __ ## f ## _alias (__VA_ARGS__) \
196 : (__glibc_unsafe_len (__l, __s, __osz) \
197 ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \
198 : __ ## f ## _chk (__VA_ARGS__, __osz)))
199
200/* Fortify function f, where object size argument passed to f is the number of
201 elements and not total size. */
202
203#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
204 (__glibc_safe_or_unknown_len (__l, __s, __osz) \
205 ? __ ## f ## _alias (__VA_ARGS__) \
206 : (__glibc_unsafe_len (__l, __s, __osz) \
207 ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
208 : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))
209#endif
210
153211#if __GNUC_PREREQ (4,3)
154212# define __warnattr(msg) __attribute__((__warning__ (msg)))
155213# define __errordecl(name, msg) \
......@@ -210,6 +268,14 @@
210268# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
211269# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
212270
271#ifndef __REDIRECT_FORTIFY
272#define __REDIRECT_FORTIFY __REDIRECT
273#endif
274
275#ifndef __REDIRECT_FORTIFY_NTH
276#define __REDIRECT_FORTIFY_NTH __REDIRECT_NTH
277#endif
278
213279/*
214280#elif __SOME_OTHER_COMPILER__
215281
......@@ -243,6 +309,15 @@
243309# define __attribute_alloc_size__(params) /* Ignore. */
244310#endif
245311
312/* Tell the compiler which argument to an allocation function
313 indicates the alignment of the allocation. */
314#if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__alloc_align__)
315# define __attribute_alloc_align__(param) \
316 __attribute__ ((__alloc_align__ param))
317#else
318# define __attribute_alloc_align__(param) /* Ignore. */
319#endif
320
246321/* At some point during the gcc 2.96 development the `pure' attribute
247322 for functions was introduced. We don't want to use it unconditionally
248323 (although this would be possible) since it generates warnings. */
......@@ -318,16 +393,18 @@
318393#endif
319394
320395/* The nonnull function attribute marks pointer parameters that
321 must not be NULL. */
322#ifndef __nonnull
396 must not be NULL. This has the name __nonnull in glibc,
397 and __attribute_nonnull__ in files shared with Gnulib to avoid
398 collision with a different __nonnull in DragonFlyBSD 5.9. */
399#ifndef __attribute_nonnull__
323400# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
324# define __nonnull(params) __attribute__ ((__nonnull__ params))
401# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
325402# else
326# define __nonnull(params)
403# define __attribute_nonnull__(params)
327404# endif
328#elif !defined __GLIBC__
329# undef __nonnull
330# define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params)
405#endif
406#ifndef __nonnull
407# define __nonnull(params) __attribute_nonnull__ (params)
331408#endif
332409
333410/* The returns_nonnull function attribute marks the return type of the function
......@@ -493,9 +570,9 @@
493570 [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
494571#endif
495572
496/* The #ifndef lets Gnulib avoid including these on non-glibc
497 platforms, where the includes typically do not exist. */
498#ifdef __GLIBC__
573/* Gnulib avoids including these, as they don't work on non-glibc or
574 older glibc platforms. */
575#ifndef __GNULIB_CDEFS
499576# include <bits/wordsize.h>
500577# include <bits/long-double.h>
501578#endif
......@@ -507,6 +584,8 @@
507584# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
508585# define __LDBL_REDIR_DECL(name) \
509586 extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
587# define __REDIRECT_LDBL(name, proto, alias) \
588 name proto __asm (__ASMNAME ("__" #alias "ieee128"))
510589
511590/* Alias name defined automatically, with leading underscores. */
512591# define __LDBL_REDIR2_DECL(name) \
......@@ -524,7 +603,6 @@
524603 __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
525604
526605/* Unused. */
527# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
528606# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
529607
530608# else
......@@ -603,12 +681,22 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
603681 size-index is not provided:
604682 access (access-mode, <ref-index> [, <size-index>]) */
605683# define __attr_access(x) __attribute__ ((__access__ x))
684/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may
685 use the access attribute to get object sizes from function definition
686 arguments, so we can't use them on functions we fortify. Drop the object
687 size hints for such functions. */
688# if __USE_FORTIFY_LEVEL == 3
689# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o)))
690# else
691# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s))
692# endif
606693# if __GNUC_PREREQ (11, 0)
607694# define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno)))
608695# else
609696# define __attr_access_none(argno)
610697# endif
611698#else
699# define __fortified_attr_access(a, o, s)
612700# define __attr_access(x)
613701# define __attr_access_none(argno)
614702#endif
lib/libc/glibc/misc/sys/select.h+1-1
......@@ -1,5 +1,5 @@
11/* `fd_set' type and related macros, and `select'/`pselect' declarations.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/posix/bits/cpu-set.h+1-1
......@@ -1,6 +1,6 @@
11/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
22 scheduling interface.
3 Copyright (C) 1996-2021 Free Software Foundation, Inc.
3 Copyright (C) 1996-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/posix/bits/types.h+1-1
......@@ -1,5 +1,5 @@
11/* bits/types.h -- definitions of __*_t types underlying *_t types.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/posix/sys/types.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/signal/signal.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/alloca.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/bits/stdlib-float.h+1-1
......@@ -1,5 +1,5 @@
11/* Floating-point inline functions for stdlib.h.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/errno.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/exit.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/stdlib.h+139-4
......@@ -1,4 +1,5 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
2 Copyright The GNU Toolchain Authors.
23 This file is part of the GNU C Library.
34
45 The GNU C Library is free software; you can redistribute it and/or
......@@ -207,6 +208,71 @@ extern unsigned long long int strtoull (const char *__restrict __nptr,
207208 __THROW __nonnull ((1));
208209#endif /* ISO C99 or use MISC. */
209210
211/* Versions of the above functions that handle '0b' and '0B' prefixes
212 in base 0 or 2. */
213#if __GLIBC_USE (C2X_STRTOL)
214# ifdef __REDIRECT
215extern long int __REDIRECT_NTH (strtol, (const char *__restrict __nptr,
216 char **__restrict __endptr,
217 int __base), __isoc23_strtol)
218 __nonnull ((1));
219extern unsigned long int __REDIRECT_NTH (strtoul,
220 (const char *__restrict __nptr,
221 char **__restrict __endptr,
222 int __base), __isoc23_strtoul)
223 __nonnull ((1));
224# ifdef __USE_MISC
225__extension__
226extern long long int __REDIRECT_NTH (strtoq, (const char *__restrict __nptr,
227 char **__restrict __endptr,
228 int __base), __isoc23_strtoll)
229 __nonnull ((1));
230__extension__
231extern unsigned long long int __REDIRECT_NTH (strtouq,
232 (const char *__restrict __nptr,
233 char **__restrict __endptr,
234 int __base), __isoc23_strtoull)
235 __nonnull ((1));
236# endif
237__extension__
238extern long long int __REDIRECT_NTH (strtoll, (const char *__restrict __nptr,
239 char **__restrict __endptr,
240 int __base), __isoc23_strtoll)
241 __nonnull ((1));
242__extension__
243extern unsigned long long int __REDIRECT_NTH (strtoull,
244 (const char *__restrict __nptr,
245 char **__restrict __endptr,
246 int __base), __isoc23_strtoull)
247 __nonnull ((1));
248# else
249extern long int __isoc23_strtol (const char *__restrict __nptr,
250 char **__restrict __endptr, int __base)
251 __THROW __nonnull ((1));
252extern unsigned long int __isoc23_strtoul (const char *__restrict __nptr,
253 char **__restrict __endptr,
254 int __base)
255 __THROW __nonnull ((1));
256__extension__
257extern long long int __isoc23_strtoll (const char *__restrict __nptr,
258 char **__restrict __endptr, int __base)
259 __THROW __nonnull ((1));
260__extension__
261extern unsigned long long int __isoc23_strtoull (const char *__restrict __nptr,
262 char **__restrict __endptr,
263 int __base)
264 __THROW __nonnull ((1));
265# define strtol __isoc23_strtol
266# define strtoul __isoc23_strtoul
267# ifdef __USE_MISC
268# define strtoq __isoc23_strtoll
269# define strtouq __isoc23_strtoull
270# endif
271# define strtoll __isoc23_strtoll
272# define strtoull __isoc23_strtoull
273# endif
274#endif
275
210276/* Convert a floating-point number to a string. */
211277#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
212278extern int strfromd (char *__dest, size_t __size, const char *__format,
......@@ -292,6 +358,60 @@ extern unsigned long long int strtoull_l (const char *__restrict __nptr,
292358 int __base, locale_t __loc)
293359 __THROW __nonnull ((1, 4));
294360
361/* Versions of the above functions that handle '0b' and '0B' prefixes
362 in base 0 or 2. */
363# if __GLIBC_USE (C2X_STRTOL)
364# ifdef __REDIRECT
365extern long int __REDIRECT_NTH (strtol_l, (const char *__restrict __nptr,
366 char **__restrict __endptr,
367 int __base, locale_t __loc),
368 __isoc23_strtol_l)
369 __nonnull ((1, 4));
370extern unsigned long int __REDIRECT_NTH (strtoul_l,
371 (const char *__restrict __nptr,
372 char **__restrict __endptr,
373 int __base, locale_t __loc),
374 __isoc23_strtoul_l)
375 __nonnull ((1, 4));
376__extension__
377extern long long int __REDIRECT_NTH (strtoll_l, (const char *__restrict __nptr,
378 char **__restrict __endptr,
379 int __base,
380 locale_t __loc),
381 __isoc23_strtoll_l)
382 __nonnull ((1, 4));
383__extension__
384extern unsigned long long int __REDIRECT_NTH (strtoull_l,
385 (const char *__restrict __nptr,
386 char **__restrict __endptr,
387 int __base, locale_t __loc),
388 __isoc23_strtoull_l)
389 __nonnull ((1, 4));
390# else
391extern long int __isoc23_strtol_l (const char *__restrict __nptr,
392 char **__restrict __endptr, int __base,
393 locale_t __loc) __THROW __nonnull ((1, 4));
394extern unsigned long int __isoc23_strtoul_l (const char *__restrict __nptr,
395 char **__restrict __endptr,
396 int __base, locale_t __loc)
397 __THROW __nonnull ((1, 4));
398__extension__
399extern long long int __isoc23_strtoll_l (const char *__restrict __nptr,
400 char **__restrict __endptr,
401 int __base, locale_t __loc)
402 __THROW __nonnull ((1, 4));
403__extension__
404extern unsigned long long int __isoc23_strtoull_l (const char *__restrict __nptr,
405 char **__restrict __endptr,
406 int __base, locale_t __loc)
407 __THROW __nonnull ((1, 4));
408# define strtol_l __isoc23_strtol_l
409# define strtoul_l __isoc23_strtoul_l
410# define strtoll_l __isoc23_strtoll_l
411# define strtoull_l __isoc23_strtoull_l
412# endif
413# endif
414
295415extern double strtod_l (const char *__restrict __nptr,
296416 char **__restrict __endptr, locale_t __loc)
297417 __THROW __nonnull ((1, 3));
......@@ -532,6 +652,19 @@ extern int seed48_r (unsigned short int __seed16v[3],
532652extern int lcong48_r (unsigned short int __param[7],
533653 struct drand48_data *__buffer)
534654 __THROW __nonnull ((1, 2));
655
656/* Return a random integer between zero and 2**32-1 (inclusive). */
657extern __uint32_t arc4random (void)
658 __THROW __wur;
659
660/* Fill the buffer with random data. */
661extern void arc4random_buf (void *__buf, size_t __size)
662 __THROW __nonnull ((1));
663
664/* Return a random number between zero (inclusive) and the specified
665 limit (exclusive). */
666extern __uint32_t arc4random_uniform (__uint32_t __upper_bound)
667 __THROW __wur;
535668# endif /* Use misc. */
536669#endif /* Use misc or X/Open. */
537670
......@@ -589,7 +722,8 @@ extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
589722#ifdef __USE_ISOC11
590723/* ISO C variant of aligned allocation. */
591724extern void *aligned_alloc (size_t __alignment, size_t __size)
592 __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
725 __THROW __attribute_malloc__ __attribute_alloc_align__ ((1))
726 __attribute_alloc_size__ ((2)) __wur;
593727#endif
594728
595729/* Abort execution and generate a core-dump. */
......@@ -943,7 +1077,8 @@ extern size_t mbstowcs (wchar_t *__restrict __pwcs,
9431077extern size_t wcstombs (char *__restrict __s,
9441078 const wchar_t *__restrict __pwcs, size_t __n)
9451079 __THROW
946 __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2));
1080 __fortified_attr_access (__write_only__, 1, 3)
1081 __attr_access ((__read_only__, 2));
9471082
9481083#ifdef __USE_MISC
9491084/* Determine whether the string value of RESPONSE matches the affirmation
......@@ -997,7 +1132,7 @@ extern char *ptsname (int __fd) __THROW __wur;
9971132 terminal associated with the master FD is open on in BUF.
9981133 Return 0 on success, otherwise an error number. */
9991134extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
1000 __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3));
1135 __THROW __nonnull ((2)) __fortified_attr_access (__write_only__, 2, 3);
10011136
10021137/* Open a master pseudo terminal and return its file descriptor. */
10031138extern int getpt (void);
lib/libc/glibc/string/bits/endian.h+1-1
......@@ -1,5 +1,5 @@
11/* Endian macros for string.h functions
2 Copyright (C) 1992-2021 Free Software Foundation, Inc.
2 Copyright (C) 1992-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/string/endian.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/aarch64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for AArch64.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33
44 This file is part of the GNU C Library.
55
lib/libc/glibc/sysdeps/aarch64/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for AArch64.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33
44 This file is part of the GNU C Library.
55
lib/libc/glibc/sysdeps/aarch64/dl-sysdep.h deleted-25
......@@ -1,25 +0,0 @@
1/* Copyright (C) 2002-2021 Free Software Foundation, Inc.
2
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include_next <dl-sysdep.h>
20
21/* _dl_argv cannot be attribute_relro, because _dl_start_user
22 might write into it after _dl_start returns. */
23#define DL_ARGV_NOT_RELRO 1
24
25#define DL_EXTERN_PROTECTED_DATA
lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2002-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2002-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/aarch64/start.S+22-5
......@@ -1,11 +1,28 @@
1/* Copyright (C) 1995-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 In addition to the permissions in the GNU Lesser General Public
11 License, the Free Software Foundation gives you unlimited
12 permission to link the compiled version of this file with other
13 programs, and to distribute those programs without any restriction
14 coming from the use of this file. (The GNU Lesser General Public
15 License restrictions do apply in other respects; for example, they
16 cover modification of the file, and distribution when not linked
17 into another program.)
18
19 Note that people who make modified versions of this file are not
20 obligated to grant this special exception for their modified
21 versions; it is their choice whether to do so. The GNU Lesser
22 General Public License gives permission to release a modified
23 version without this exception; this exception also makes it
24 possible to release a modified version which carries forward this
25 exception.
926
1027 The GNU C Library is distributed in the hope that it will be useful,
1128 but WITHOUT ANY WARRANTY; without even the implied warranty of
......@@ -13,7 +30,7 @@
1330 Lesser General Public License for more details.
1431
1532 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
33 License along with the GNU C Library; if not, see
1734 <https://www.gnu.org/licenses/>. */
1835
1936#include <sysdep.h>
lib/libc/glibc/sysdeps/aarch64/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/alpha/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for Alpha.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/alpha/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for Alpha.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/alpha/dl-sysdep.h deleted-23
......@@ -1,23 +0,0 @@
1/* System-specific settings for dynamic linker code. Alpha version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include_next <dl-sysdep.h>
20
21/* _dl_argv cannot be attribute_relro, because _dl_start_user
22 might write into it after _dl_start returns. */
23#define DL_ARGV_NOT_RELRO 1
lib/libc/glibc/sysdeps/alpha/start.S+1-2
......@@ -1,7 +1,6 @@
11/* Startup code for Alpha/ELF.
2 Copyright (C) 1993-2021 Free Software Foundation, Inc.
2 Copyright (C) 1993-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Richard Henderson <rth@tamu.edu>
54
65 The GNU C Library is free software; you can redistribute it and/or
76 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/arc/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for ARC.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/arm-features.h+1-1
......@@ -1,5 +1,5 @@
11/* Macros to test for CPU features on ARM. Generic ARM version.
2 Copyright (C) 2012-2022 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for ARM.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for ARM.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/dl-sysdep.h deleted-25
......@@ -1,25 +0,0 @@
1/* System-specific settings for dynamic linker code. Alpha version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include_next <dl-sysdep.h>
20
21/* _dl_argv cannot be attribute_relro, because _dl_start_user
22 might write into it after _dl_start returns. */
23#define DL_ARGV_NOT_RELRO 1
24
25#define DL_EXTERN_PROTECTED_DATA
lib/libc/glibc/sysdeps/arm/start.S+1-1
......@@ -1,5 +1,5 @@
11/* Startup code for ARM & ELF
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/sysdep.h+1-45
......@@ -1,5 +1,5 @@
11/* Assembler macros for ARM.
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 Copyright (C) 1997-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -293,47 +293,3 @@
293293#else
294294# define PC_OFS 8
295295#endif
296
297/* Pointer mangling support. */
298#if (IS_IN (rtld) \
299 || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
300# ifdef __ASSEMBLER__
301# define PTR_MANGLE_LOAD(guard, tmp) \
302 LDR_HIDDEN (guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local), 0)
303# define PTR_MANGLE(dst, src, guard, tmp) \
304 PTR_MANGLE_LOAD(guard, tmp); \
305 PTR_MANGLE2(dst, src, guard)
306/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */
307# define PTR_MANGLE2(dst, src, guard) \
308 eor dst, src, guard
309# define PTR_DEMANGLE(dst, src, guard, tmp) \
310 PTR_MANGLE (dst, src, guard, tmp)
311# define PTR_DEMANGLE2(dst, src, guard) \
312 PTR_MANGLE2 (dst, src, guard)
313# else
314extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
315# define PTR_MANGLE(var) \
316 (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
317# define PTR_DEMANGLE(var) PTR_MANGLE (var)
318# endif
319#else
320# ifdef __ASSEMBLER__
321# define PTR_MANGLE_LOAD(guard, tmp) \
322 LDR_GLOBAL (guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard), 0);
323# define PTR_MANGLE(dst, src, guard, tmp) \
324 PTR_MANGLE_LOAD(guard, tmp); \
325 PTR_MANGLE2(dst, src, guard)
326/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */
327# define PTR_MANGLE2(dst, src, guard) \
328 eor dst, src, guard
329# define PTR_DEMANGLE(dst, src, guard, tmp) \
330 PTR_MANGLE (dst, src, guard, tmp)
331# define PTR_DEMANGLE2(dst, src, guard) \
332 PTR_MANGLE2 (dst, src, guard)
333# else
334extern uintptr_t __pointer_chk_guard attribute_relro;
335# define PTR_MANGLE(var) \
336 (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
337# define PTR_DEMANGLE(var) PTR_MANGLE (var)
338# endif
339#endif
lib/libc/glibc/sysdeps/csky/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for C-SKY.
2 Copyright (C) 2018-2021 Free Software Foundation, Inc.
2 Copyright (C) 2018-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h+1-1
......@@ -1,5 +1,5 @@
11/* Configuration of lookup functions.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/dl-sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* System-specific settings for dynamic linker code. Generic version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/dwarf2.h+1-3
......@@ -1,8 +1,6 @@
11/* Declarations and definitions of codes relating to the DWARF2 symbolic
22 debugging information format.
3 Copyright (C) 1992-2021 Free Software Foundation, Inc.
4 Contributed by Gary Funck (gary@intrepid.com). Derived from the
5 DWARF 1 implementation written by Ron Guilmette (rfg@monkeys.com).
3 Copyright (C) 1992-2023 Free Software Foundation, Inc.
64
75 This file is part of the GNU C Library.
86
lib/libc/glibc/sysdeps/generic/libc-lock.h+1-1
......@@ -1,5 +1,5 @@
11/* libc-internal interface for mutex locks. Stub version.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/libc-symver.h+1-1
......@@ -1,5 +1,5 @@
11/* Symbol version management.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/single-thread.h+1-1
......@@ -1,5 +1,5 @@
11/* Single thread optimization, generic version.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
2 Copyright (C) 2019-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/symbol-hacks.h+2-1
......@@ -1,6 +1,7 @@
11/* Some compiler optimizations may transform loops into memset/memmove
22 calls and without proper declaration it may generate PLT calls. */
3#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED
3#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED \
4 && !defined LIBC_NONSHARED
45asm ("memmove = __GI_memmove");
56asm ("memset = __GI_memset");
67asm ("memcpy = __GI_memcpy");
lib/libc/glibc/sysdeps/generic/sysdep.h+2-2
......@@ -1,5 +1,5 @@
11/* Generic asm macros used on many machines.
2 Copyright (C) 1991-2021 Free Software Foundation, Inc.
2 Copyright (C) 1991-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -35,7 +35,7 @@
3535# endif
3636#endif
3737
38/* Makros to generate eh_frame unwind information. */
38/* Macros to generate eh_frame unwind information. */
3939#ifdef __ASSEMBLER__
4040# define cfi_startproc .cfi_startproc
4141# define cfi_endproc .cfi_endproc
lib/libc/glibc/sysdeps/generic/tls.h+6-16
......@@ -1,5 +1,5 @@
11/* Definition for thread-local data handling. Generic version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -19,6 +19,11 @@
1919/* An architecture-specific version of this file has to defined a
2020 number of symbols:
2121
22 TCB_ALIGNMENT
23
24 Alignment of THREAD_SELF (struct pthread *) and the thread
25 pointer.
26
2227 TLS_TCB_AT_TP or TLS_DTV_AT_TP
2328
2429 The presence of one of these symbols signals which variant of
......@@ -43,15 +48,6 @@
4348 dynamic linker itself. There are no threads in use at that time.
4449
4550
46 TLS_TCB_ALIGN
47
48 Alignment requirements for the TCB structure.
49
50 TLS_INIT_TCB_ALIGN
51
52 Similarly, but for the structure used at startup time.
53
54
5551 INSTALL_DTV(tcb, init_dtv)
5652
5753 This macro must install the given initial DTV into the thread control
......@@ -71,10 +67,4 @@
7167 This macro returns the address of the DTV of the current thread.
7268 This normally is done using the thread register which points
7369 to the dtv or the TCB (from which the DTV can found).
74
75
76 THREAD_GSCOPE_IN_TCB
77
78 This should be set to 1 if the global scope flag is stored within the TCB.
79 When set to 0, GL(_dl_thread_gscope_count) will be defined to store it.
8070 */
lib/libc/glibc/sysdeps/hppa/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for HPPA
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/hppa/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for HPPA
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/hppa/entry.h-5
......@@ -1,6 +1,4 @@
1#ifndef __ASSEMBLY__
21extern void _start (void);
3#endif
42
53/* Lives in libgcc.so and canonicalizes function pointers for comparison. */
64extern unsigned int __canonicalize_funcptr_for_compare (unsigned int fptr);
......@@ -8,6 +6,3 @@ extern unsigned int __canonicalize_funcptr_for_compare (unsigned int fptr);
86/* The function's entry point is stored in the first word of the
97 function descriptor (plabel) of _start(). */
108#define ENTRY_POINT __canonicalize_funcptr_for_compare((unsigned int)_start)
11
12/* We have to provide a special declaration. */
13#define ENTRY_POINT_DECL(class) class void _start (void);
lib/libc/glibc/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2005-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2005-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/hppa/start.S+1-1
......@@ -1,5 +1,5 @@
11/* ELF startup code for HPPA.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/hppa/sysdep.h+1-2
......@@ -1,7 +1,6 @@
11/* Assembler macros for HP/PA.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
2 Copyright (C) 1999-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
54
65 The GNU C Library is free software; you can redistribute it and/or
76 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/htl/bits/pthread.h+2-2
......@@ -1,5 +1,5 @@
11/* Pthread data structures. Generic version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -19,7 +19,7 @@
1919#ifndef _BITS_PTHREAD_H
2020#define _BITS_PTHREAD_H 1
2121
22typedef int __pthread_t;
22#include <bits/types/__pthread_t.h>
2323
2424/* Return true if __T1 and __T2 both name the same thread. Otherwise,
2525 false. */
lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h+2-2
......@@ -1,5 +1,5 @@
11/* Common threading primitives definitions for both POSIX and C11.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -21,9 +21,9 @@
2121
2222#include <bits/pthreadtypes-arch.h>
2323#include <bits/types/struct___pthread_once.h>
24#include <bits/types/__thrd_t.h>
2425
2526typedef int __tss_t;
26typedef int __thrd_t;
2727
2828typedef union
2929{
lib/libc/glibc/sysdeps/htl/libc-lockP.h+1-1
......@@ -1,5 +1,5 @@
11/* Private libc-internal interface for mutex locks.
2 Copyright (C) 2015-2021 Free Software Foundation, Inc.
2 Copyright (C) 2015-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/htl/pthread.h+7-7
......@@ -1,5 +1,5 @@
11/* Posix threads. Hurd version.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -623,7 +623,7 @@ extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict
623623 int *__restrict __pshared)
624624 __THROW __nonnull ((1, 2));
625625
626/* Set the value of the process shared atrribute in *ATTR to
626/* Set the value of the process shared attribute in *ATTR to
627627 PSHARED. */
628628extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
629629 int __pshared)
......@@ -645,7 +645,7 @@ extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
645645# include <bits/types/struct___pthread_rwlock.h>
646646
647647# define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER
648/* Create a rwlock object with attributes given by ATTR and strore the
648/* Create a rwlock object with attributes given by ATTR and store the
649649 result in *RWLOCK. */
650650extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
651651 const pthread_rwlockattr_t *__restrict __attr)
......@@ -709,7 +709,7 @@ extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
709709
710710
711711
712/* Cancelation. */
712/* Cancellation. */
713713
714714/* Register a cleanup handler. */
715715extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg);
......@@ -769,7 +769,7 @@ extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restri
769769 int *__restrict __pshared)
770770 __THROW __nonnull ((1, 2));
771771
772/* Set the value of the process shared atrribute in *ATTR to
772/* Set the value of the process shared attribute in *ATTR to
773773 PSHARED. */
774774extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
775775 int __pshared)
......@@ -878,12 +878,12 @@ extern int pthread_getcpuclockid (pthread_t __thr, __clockid_t *__clock)
878878
879879/* Scheduling. */
880880
881/* Return thread THREAD's scheduling paramters. */
881/* Return thread THREAD's scheduling parameters. */
882882extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy,
883883 struct sched_param *__restrict __param)
884884 __THROW __nonnull ((2, 3));
885885
886/* Set thread THREAD's scheduling paramters. */
886/* Set thread THREAD's scheduling parameters. */
887887extern int pthread_setschedparam (pthread_t __thr, int __policy,
888888 const struct sched_param *__param)
889889 __THROW __nonnull ((3));
lib/libc/glibc/sysdeps/i386/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for x86.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for x86.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h+1-1
......@@ -1,5 +1,5 @@
11/* Machine-specific pthread type layouts. Hurd i386 version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/start.S+10-5
......@@ -1,5 +1,5 @@
11/* Startup code compliant to the ELF i386 ABI.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -98,11 +98,10 @@ ENTRY (_start)
9898 pushl main@GOT(%ebx)
9999# else
100100 /* Avoid relocation in static PIE since _start is called before
101 it is relocated. Don't use "leal main@GOTOFF(%ebx), %eax"
102 since main may be in a shared object. Linker will convert
103 "movl main@GOT(%ebx), %eax" to "leal main@GOTOFF(%ebx), %eax"
101 it is relocated. This also avoid rely on linker optimization to
102 transform 'movl main@GOT(%ebx), %eax' to 'leal main@GOTOFF(%ebx)'
104103 if main is defined locally. */
105 movl main@GOT(%ebx), %eax
104 leal __wrap_main@GOTOFF(%ebx), %eax
106105 pushl %eax
107106# endif
108107
......@@ -130,6 +129,12 @@ ENTRY (_start)
1301291: movl (%esp), %ebx
131130 ret
132131#endif
132
133#if defined PIC && !defined SHARED
134__wrap_main:
135 _CET_ENDBR
136 jmp main@PLT
137#endif
133138END (_start)
134139
135140/* To fulfill the System V/i386 ABI we need this symbol. Yuck, it's so
lib/libc/glibc/sysdeps/i386/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* Hacks needed for symbol manipulation. i386 version.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for i386.
2 Copyright (C) 1991-2021 Free Software Foundation, Inc.
2 Copyright (C) 1991-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/ia64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for IA64.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/ia64/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for ARM.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/ia64/dl-dtprocnum.h+1-1
......@@ -1,5 +1,5 @@
11/* Configuration of lookup functions. IA-64 version.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/ia64/dl-sysdep.h deleted-23
......@@ -1,23 +0,0 @@
1/* System-specific settings for dynamic linker code. IA-64 version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include_next <dl-sysdep.h>
20
21/* _dl_argv cannot be attribute_relro, because _dl_start_user
22 might write into it after _dl_start returns. */
23#define DL_ARGV_NOT_RELRO 1
lib/libc/glibc/sysdeps/ia64/entry.h-5
......@@ -1,13 +1,8 @@
11#include <link.h>
22#include <dl-fptr.h>
33
4#ifndef __ASSEMBLY__
54extern void _start (void);
6#endif
75
86/* The function's entry point is stored in the first word of the
97 function descriptor (plabel) of _start(). */
108#define ENTRY_POINT ELF_PTR_TO_FDESC (_start)->ip
11
12/* We have to provide a special declaration. */
13#define ENTRY_POINT_DECL(class) class void _start (void);
lib/libc/glibc/sysdeps/ia64/start.S+1-2
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1999-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/ia64/sysdep.h+1-2
......@@ -1,6 +1,5 @@
1/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for Coldfire.
2 Copyright (C) 1998-2021 Free Software Foundation, Inc.
2 Copyright (C) 1998-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for m68k.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for m68k.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for m680x0.
2 Copyright (C) 2010-2021 Free Software Foundation, Inc.
2 Copyright (C) 2010-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h+1-2
......@@ -1,6 +1,5 @@
1/* Copyright (C) 2010-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2010-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/m68k/start.S+1-1
......@@ -1,5 +1,5 @@
11/* Startup code compliant to the ELF m68k ABI.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* Hacks needed for symbol manipulation. m68k version.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for m68k.
2 Copyright (C) 1998-2021 Free Software Foundation, Inc.
2 Copyright (C) 1998-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mach/i386/sysdep.h deleted-59
......@@ -1,59 +0,0 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
2
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _MACH_I386_SYSDEP_H
20#define _MACH_I386_SYSDEP_H 1
21
22/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
23#include <dl-sysdep.h>
24#include <tls.h>
25
26#define LOSE asm volatile ("hlt")
27
28#define SNARF_ARGS(entry_sp, argc, argv, envp) \
29 do \
30 { \
31 char **p; \
32 argc = (int) *entry_sp; \
33 argv = (char **) (entry_sp + 1); \
34 p = argv; \
35 while (*p++ != NULL) \
36 ; \
37 if (p >= (char **) argv[0]) \
38 --p; \
39 envp = p; \
40 } while (0)
41
42#define RETURN_TO(sp, pc, retval) \
43 asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \
44 : : "g" (sp), "r" (pc), "a" (retval))
45
46
47#define STACK_GROWTH_DOWN
48
49/* Get the machine-independent Mach definitions. */
50#include <sysdeps/mach/sysdep.h>
51
52
53/* This should be rearranged, but at the moment this file provides
54 the most useful definitions for assembler syntax details. */
55#undef ENTRY
56#undef ALIGN
57#include <sysdeps/unix/i386/sysdep.h>
58
59#endif /* mach/i386/sysdep.h */
lib/libc/glibc/sysdeps/mach/libc-lock.h+4-5
......@@ -1,5 +1,5 @@
11/* libc-internal interface for mutex locks. Mach cthreads version.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -34,9 +34,8 @@ typedef struct
3434
3535typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
3636
37extern char __libc_lock_self0[0];
3837#define __libc_lock_owner_self() \
39 (__LIBC_NO_TLS () ? (void *)&__libc_lock_self0 : THREAD_SELF)
38 (__LIBC_NO_TLS () ? (void *) 1 : THREAD_SELF)
4039
4140#else
4241typedef struct __libc_lock_opaque__ __libc_lock_t;
......@@ -71,14 +70,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
7170
7271/* Lock the named lock variable. */
7372#define __libc_lock_lock(NAME) \
74 ({ lll_lock ((NAME), 0); 0; })
73 ({ lll_lock ((NAME), LLL_PRIVATE); 0; })
7574
7675/* Lock the named lock variable. */
7776#define __libc_lock_trylock(NAME) lll_trylock (NAME)
7877
7978/* Unlock the named lock variable. */
8079#define __libc_lock_unlock(NAME) \
81 ({ lll_unlock ((NAME), 0); 0; })
80 ({ lll_unlock ((NAME), LLL_PRIVATE); 0; })
8281
8382#define __libc_lock_define_recursive(CLASS,NAME) \
8483 CLASS __libc_lock_recursive_t NAME;
lib/libc/glibc/sysdeps/mach/sysdep.h+3-2
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1994-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1994-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -30,6 +30,7 @@
3030/* For ELF we need to add the `.type' directive to make shared libraries
3131 work right. */
3232#undef ENTRY
33#undef ENTRY2
3334#define ENTRY(name) \
3435 .globl name; \
3536 .align ALIGN; \
......@@ -44,7 +45,7 @@
4445
4546#ifndef __ASSEMBLER__
4647#define FATAL_PREPARE_INCLUDE <mach/mig_support.h>
47#define FATAL_PREPARE __mig_dealloc_reply_port (MACH_PORT_NULL)
48#define FATAL_PREPARE __mig_dealloc_reply_port (__mig_get_reply_port ())
4849#endif
4950
5051/* sysdeps/mach/MACHINE/sysdep.h should define the following macros. */
lib/libc/glibc/sysdeps/microblaze/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MicroBlaze.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/microblaze/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MicroBlaze.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/microblaze/start.S+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/microblaze/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h+1-1
......@@ -1,5 +1,5 @@
11/* Configuration of lookup functions. MIPS version.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/mips32/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MIPS (o32).
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/mips32/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MIPS (o32).
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/mips64/n32/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MIPS (n32).
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/mips64/n32/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MIPS (n32).
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/mips64/n64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MIPS (n64).
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/mips64/n64/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for MIPS (n64).
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h+1-1
......@@ -1,5 +1,5 @@
11/* Machine-specific pthread type layouts. MIPS version.
2 Copyright (C) 2005-2021 Free Software Foundation, Inc.
2 Copyright (C) 2005-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/start.S+2-2
......@@ -1,5 +1,5 @@
11/* Startup code compliant to the ELF Mips ABI.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -60,7 +60,7 @@
6060 ...
6161 NULL
6262 ra ($31) The return address register is set to zero so that programs
63 that search backword through stack frames recognize the last
63 that search backward through stack frames recognize the last
6464 stack frame.
6565*/
6666
lib/libc/glibc/sysdeps/nios2/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for Nios II.
2 Copyright (C) 2015-2021 Free Software Foundation, Inc.
2 Copyright (C) 2015-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h+1-1
......@@ -1,5 +1,5 @@
11/* Declaration of common pthread types for all architectures.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h+5-19
......@@ -1,5 +1,5 @@
11/* Common threading primitives definitions for both POSIX and C11.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -43,6 +43,8 @@
4343
4444#include <bits/pthreadtypes-arch.h>
4545
46#include <bits/atomic_wide_counter.h>
47
4648
4749/* Common definition of pthread_mutex_t. */
4850
......@@ -91,24 +93,8 @@ typedef struct __pthread_internal_slist
9193
9294struct __pthread_cond_s
9395{
94 __extension__ union
95 {
96 __extension__ unsigned long long int __wseq;
97 struct
98 {
99 unsigned int __low;
100 unsigned int __high;
101 } __wseq32;
102 };
103 __extension__ union
104 {
105 __extension__ unsigned long long int __g1_start;
106 struct
107 {
108 unsigned int __low;
109 unsigned int __high;
110 } __g1_start32;
111 };
96 __atomic_wide_counter __wseq;
97 __atomic_wide_counter __g1_start;
11298 unsigned int __g_refs[2] __LOCK_ALIGNMENT;
11399 unsigned int __g_size[2];
114100 unsigned int __g1_orig_size;
lib/libc/glibc/sysdeps/nptl/libc-lock.h+8-2
......@@ -1,5 +1,5 @@
11/* libc-internal interface for mutex locks. NPTL version.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -22,6 +22,7 @@
2222#include <pthread.h>
2323#define __need_NULL
2424#include <stddef.h>
25#include <libc-lock-arch.h>
2526
2627
2728/* Mutex type. */
......@@ -29,7 +30,12 @@
2930# if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
3031typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
3132# else
32typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
33typedef struct
34{
35 int lock __LIBC_LOCK_ALIGNMENT;
36 int cnt;
37 void *owner;
38} __libc_lock_recursive_t;
3339# endif
3440#else
3541typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
lib/libc/glibc/sysdeps/nptl/libc-lockP.h+3-2
......@@ -1,5 +1,5 @@
11/* Private libc-internal interface for mutex locks. NPTL version.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -32,9 +32,10 @@
3232 ld.so might be used on old kernels with a different libc.so. */
3333#include <lowlevellock.h>
3434#include <tls.h>
35#include <libc-lock-arch.h>
3536
3637/* Mutex type. */
37typedef int __libc_lock_t;
38typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
3839typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
3940typedef pthread_rwlock_t __libc_rwlock_t;
4041
lib/libc/glibc/sysdeps/nptl/pthread.h+6-6
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2002-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2002-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -516,7 +516,7 @@ extern int pthread_once (pthread_once_t *__once_control,
516516 exception in C++ code. If cancellation is implemented by unwinding
517517 this is necessary to have the compiler generate the unwind information. */
518518
519/* Set cancelability state of current thread to STATE, returning old
519/* Set cancellability state of current thread to STATE, returning old
520520 state in *OLDSTATE if OLDSTATE is not NULL. */
521521extern int pthread_setcancelstate (int __state, int *__oldstate);
522522
......@@ -933,7 +933,7 @@ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
933933# ifdef __USE_GNU
934934# ifdef __REDIRECT_NTH
935935extern int __REDIRECT_NTH (pthread_mutexattr_getrobust_np,
936 (pthread_mutex_t *, int *),
936 (pthread_mutexattr_t *, int *),
937937 pthread_mutexattr_getrobust) __nonnull ((1))
938938 __attribute_deprecated_msg__ ("\
939939pthread_mutexattr_getrobust_np is deprecated, use pthread_mutexattr_getrobust");
......@@ -949,7 +949,7 @@ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
949949# ifdef __USE_GNU
950950# ifdef __REDIRECT_NTH
951951extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np,
952 (pthread_mutex_t *, int),
952 (pthread_mutexattr_t *, int),
953953 pthread_mutexattr_setrobust) __nonnull ((1))
954954 __attribute_deprecated_msg__ ("\
955955pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust");
......@@ -981,7 +981,7 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
981981 __THROWNL __nonnull ((1));
982982
983983# ifdef __USE_XOPEN2K
984/* Try to acquire read lock for RWLOCK or return after specfied time. */
984/* Try to acquire read lock for RWLOCK or return after specified time. */
985985# ifndef __USE_TIME_BITS64
986986extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
987987 const struct timespec *__restrict
......@@ -1028,7 +1028,7 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
10281028 __THROWNL __nonnull ((1));
10291029
10301030# ifdef __USE_XOPEN2K
1031/* Try to acquire write lock for RWLOCK or return after specfied time. */
1031/* Try to acquire write lock for RWLOCK or return after specified time. */
10321032# ifndef __USE_TIME_BITS64
10331033extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
10341034 const struct timespec *__restrict
lib/libc/glibc/sysdeps/powerpc/powerpc32/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for PowerPC.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc32/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for PowerPC.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S+1-1
......@@ -1,5 +1,5 @@
11/* Startup code for programs linked with GNU libc.
2 Copyright (C) 1998-2021 Free Software Foundation, Inc.
2 Copyright (C) 1998-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* Hacks needed for symbol manipulation. powerpc version.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembly macros for 32-bit PowerPC.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
2 Copyright (C) 1999-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for PowerPC64.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc64/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for PowerPC64.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h+1-1
......@@ -1,5 +1,5 @@
11/* Configuration of lookup functions. PowerPC64 version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc64/entry.h deleted-37
......@@ -1,37 +0,0 @@
1/* Finding the entry point and start of text. PowerPC64 version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19
20#ifndef __ASSEMBLY__
21extern void _start (void);
22#endif
23
24#define ENTRY_POINT _start
25
26#if _CALL_ELF != 2
27/* We have to provide a special declaration. */
28#define ENTRY_POINT_DECL(class) class void _start (void);
29
30/* Use the address of ._start as the lowest address for which we need
31 to keep profiling records. We can't copy the ia64 scheme as our
32 entry poiny address is really the address of the function
33 descriptor, not the actual function entry. */
34#define TEXT_START \
35 ({ extern unsigned long int _start_as_data[] asm ("_start"); \
36 _start_as_data[0]; })
37#endif
lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S+3-2
......@@ -1,5 +1,5 @@
11/* Startup code for programs linked with GNU libc. PowerPC64 version.
2 Copyright (C) 1998-2021 Free Software Foundation, Inc.
2 Copyright (C) 1998-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -74,7 +74,8 @@ ENTRY (_start)
7474
7575 /* put the address of start_addresses in r8... **
7676** PPC64 ABI uses R13 for thread local, so we leave it alone */
77 ld r8,.L01@toc(r2)
77 addis r8,r2,.L01@toc@ha
78 ld r8,.L01@toc@l(r8)
7879
7980 /* and continue in libc-start, in glibc. */
8081 b JUMPTARGET(__libc_start_main)
lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h+11-7
......@@ -1,5 +1,5 @@
11/* Assembly macros for 64-bit PowerPC.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -275,12 +275,14 @@ LT_LABELSUFFIX(name,_name_end): ; \
275275/* Allocate frame and save register */
276276#define NVOLREG_SAVE \
277277 stdu r1,-SCV_FRAME_SIZE(r1); \
278 cfi_adjust_cfa_offset(SCV_FRAME_SIZE); \
278279 std r31,SCV_FRAME_NVOLREG_SAVE(r1); \
279 cfi_adjust_cfa_offset(SCV_FRAME_SIZE);
280 cfi_rel_offset(r31,SCV_FRAME_NVOLREG_SAVE);
280281
281282/* Restore register and destroy frame */
282283#define NVOLREG_RESTORE \
283284 ld r31,SCV_FRAME_NVOLREG_SAVE(r1); \
285 cfi_restore(r31); \
284286 addi r1,r1,SCV_FRAME_SIZE; \
285287 cfi_adjust_cfa_offset(-SCV_FRAME_SIZE);
286288
......@@ -331,13 +333,13 @@ LT_LABELSUFFIX(name,_name_end): ; \
331333
332334#define DO_CALL_SCV \
333335 mflr r9; \
334 std r9,FRAME_LR_SAVE(r1); \
335 cfi_offset(lr,FRAME_LR_SAVE); \
336 std r9,SCV_FRAME_SIZE+FRAME_LR_SAVE(r1); \
337 cfi_rel_offset(lr,SCV_FRAME_SIZE+FRAME_LR_SAVE); \
336338 .machine "push"; \
337339 .machine "power9"; \
338340 scv 0; \
339341 .machine "pop"; \
340 ld r9,FRAME_LR_SAVE(r1); \
342 ld r9,SCV_FRAME_SIZE+FRAME_LR_SAVE(r1); \
341343 mtlr r9; \
342344 cfi_restore(lr);
343345
......@@ -467,14 +469,16 @@ LT_LABELSUFFIX(name,_name_end): ; \
467469 .tc _rtld_global_ro[TC],_rtld_global_ro
468470# endif
469471# define __GLRO(rOUT, var, offset) \
470 ld rOUT,.LC__ ## var@toc(r2); \
472 addis rOUT,r2,.LC__ ## var@toc@ha; \
473 ld rOUT,.LC__ ## var@toc@l(rOUT); \
471474 lwz rOUT,offset(rOUT)
472475#else
473476# define __GLRO_DEF(var) \
474477.LC__ ## var: \
475478 .tc _ ## var[TC],_ ## var
476479# define __GLRO(rOUT, var, offset) \
477 ld rOUT,.LC__ ## var@toc(r2); \
480 addis rOUT,r2,.LC__ ## var@toc@ha; \
481 ld rOUT,.LC__ ## var@toc@l(rOUT); \
478482 lwz rOUT,0(rOUT)
479483#endif
480484
lib/libc/glibc/sysdeps/powerpc/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1999-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h+1-1
......@@ -1,5 +1,5 @@
11/* Machine-specific pthread type layouts. RISC-V version.
2 Copyright (C) 2011-2021 Free Software Foundation, Inc.
2 Copyright (C) 2011-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/riscv/start.S+1-1
......@@ -1,5 +1,5 @@
11/* Startup code compliant to the ELF RISC-V ABI.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-32/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for S/390.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-32/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for S/390.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-32/dl-sysdep.h deleted-23
......@@ -1,23 +0,0 @@
1/* System-specific settings for dynamic linker code. S/390 version.
2 Copyright (C) 2014-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include_next <dl-sysdep.h>
20
21/* _dl_argv cannot be attribute_relro, because _dl_start_user
22 might write into it after _dl_start returns. */
23#define DL_ARGV_NOT_RELRO 1
lib/libc/glibc/sysdeps/s390/s390-32/start.S+2-3
......@@ -1,6 +1,5 @@
11/* Startup code compliant to the ELF s390 ABI.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
43 This file is part of the GNU C Library.
54
65 The GNU C Library is free software; you can redistribute it and/or
......@@ -81,7 +80,7 @@ _start:
8180
8281 /* Usually the auxiliary vector can be expected directly after
8382 the environment variables. But we have to skip extra zeros
84 because the loader might have removed unsecure variables for
83 because the loader might have removed insecure variables for
8584 setuid programs. */
8685
8786.L26: l %r5,0(%r6)
lib/libc/glibc/sysdeps/s390/s390-32/symbol-hacks.h+1-1
......@@ -1,5 +1,5 @@
11/* Hacks needed for symbol manipulation. s390 version.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-32/sysdep.h+1-2
......@@ -1,6 +1,5 @@
11/* Assembler macros for s390.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
43 This file is part of the GNU C Library.
54
65 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-64/crti.S+1-2
......@@ -1,6 +1,5 @@
11/* Special .init and .fini section support for 64 bit S/390.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
43 This file is part of the GNU C Library.
54
65 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-64/crtn.S+1-2
......@@ -1,6 +1,5 @@
11/* Special .init and .fini section support for 64 bit S/390.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
43 This file is part of the GNU C Library.
54
65 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-64/start.S+29-2
......@@ -1,6 +1,5 @@
11/* Startup code compliant to the 64 bit S/390 ELF ABI.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
43 This file is part of the GNU C Library.
54
65 The GNU C Library is free software; you can redistribute it and/or
......@@ -85,10 +84,25 @@ _start:
8584
8685 /* Ok, now branch to the libc main routine. */
8786#ifdef PIC
87# ifdef SHARED
88 /* Used for dynamic linked position independent executable.
89 => Scrt1.o */
8890 larl %r2,main@GOTENT # load pointer to main
8991 lg %r2,0(%r2)
92# else
93 /* Used for dynamic linked position dependent executable.
94 => crt1.o (glibc configured without --disable-default-pie:
95 PIC is defined)
96 Or for static linked position independent executable.
97 => rcrt1.o (only available if glibc configured without
98 --disable-default-pie: PIC is defined) */
99 larl %r2,__wrap_main
100# endif
90101 brasl %r14,__libc_start_main@plt
91102#else
103 /* Used for dynamic/static linked position dependent executable.
104 => crt1.o (glibc configured with --disable-default-pie:
105 PIC and SHARED are not defined) */
92106 larl %r2,main # load pointer to main
93107 brasl %r14,__libc_start_main
94108#endif
......@@ -98,6 +112,19 @@ _start:
98112
99113 cfi_endproc
100114
115#if defined PIC && !defined SHARED
116 /* When main is not defined in the executable but in a shared library
117 then a wrapper is needed in crt1.o of the static-pie enabled libc,
118 because crt1.o and rcrt1.o share code and the later must avoid the
119 use of GOT relocations before __libc_start_main is called. */
120__wrap_main:
121 cfi_startproc
122 larl %r1,main@GOTENT # load pointer to main
123 lg %r1,0(%r1)
124 br %r1
125 cfi_endproc
126#endif
127
101128 /* Define a symbol for the first piece of initialized data. */
102129 .data
103130 .globl __data_start
lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h+1-2
......@@ -1,6 +1,5 @@
11/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
43 This file is part of the GNU C Library.
54
65 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sh/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for SH.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sh/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for SH.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sh/start.S+1-1
......@@ -1,5 +1,5 @@
11/* Startup code for SH & ELF.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
2 Copyright (C) 1999-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sh/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Assembler macros for SH.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
2 Copyright (C) 1999-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for sparc.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for sparc.
2 Copyright (C) 1995-2021 Free Software Foundation, Inc.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h+1-1
......@@ -1,5 +1,5 @@
11/* Configuration of lookup functions. SPARC version.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/dl-sysdep.h deleted-23
......@@ -1,23 +0,0 @@
1/* System-specific settings for dynamic linker code. SPARC version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include_next <dl-sysdep.h>
20
21/* _dl_argv cannot be attribute_relro, because _dl_start_user
22 might write into it after _dl_start returns. */
23#define DL_ARGV_NOT_RELRO 1
lib/libc/glibc/sysdeps/sparc/sparc32/start.S+1-2
......@@ -1,7 +1,6 @@
11/* Startup code for elf32-sparc
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 Copyright (C) 1997-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
54
65 The GNU C Library is free software; you can redistribute it and/or
76 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/sparc/sparc64/start.S+1-2
......@@ -1,7 +1,6 @@
11/* Startup code for elf64-sparc
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 Copyright (C) 1997-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
54
65 The GNU C Library is free software; you can redistribute it and/or
76 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/sparc/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2011-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2011-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/arm/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/i386/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h+1-2
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Brendan Kehoe (brendan@zen.org).
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h+1-2
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Alexandre Oliva <aoliva@redhat.com>.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/unix/mips/sysdep.h+1-2
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Brendan Kehoe (brendan@zen.org).
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sh/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1999-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysdep.h+21-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -57,6 +57,26 @@
5757#define INTERNAL_SYSCALL_CALL(...) \
5858 __INTERNAL_SYSCALL_DISP (__INTERNAL_SYSCALL, __VA_ARGS__)
5959
60#define __INTERNAL_SYSCALL_NCS0(name) \
61 INTERNAL_SYSCALL_NCS (name, 0)
62#define __INTERNAL_SYSCALL_NCS1(name, a1) \
63 INTERNAL_SYSCALL_NCS (name, 1, a1)
64#define __INTERNAL_SYSCALL_NCS2(name, a1, a2) \
65 INTERNAL_SYSCALL_NCS (name, 2, a1, a2)
66#define __INTERNAL_SYSCALL_NCS3(name, a1, a2, a3) \
67 INTERNAL_SYSCALL_NCS (name, 3, a1, a2, a3)
68#define __INTERNAL_SYSCALL_NCS4(name, a1, a2, a3, a4) \
69 INTERNAL_SYSCALL_NCS (name, 4, a1, a2, a3, a4)
70#define __INTERNAL_SYSCALL_NCS5(name, a1, a2, a3, a4, a5) \
71 INTERNAL_SYSCALL_NCS (name, 5, a1, a2, a3, a4, a5)
72#define __INTERNAL_SYSCALL_NCS6(name, a1, a2, a3, a4, a5, a6) \
73 INTERNAL_SYSCALL_NCS (name, 6, a1, a2, a3, a4, a5, a6)
74#define __INTERNAL_SYSCALL_NCS7(name, a1, a2, a3, a4, a5, a6, a7) \
75 INTERNAL_SYSCALL_NCS (name, 7, a1, a2, a3, a4, a5, a6, a7)
76
77#define INTERNAL_SYSCALL_NCS_CALL(...) \
78 __INTERNAL_SYSCALL_DISP (__INTERNAL_SYSCALL_NCS, __VA_ARGS__)
79
6080#define __INLINE_SYSCALL0(name) \
6181 INLINE_SYSCALL (name, 0)
6282#define __INLINE_SYSCALL1(name, a1) \
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. AArch64 version.
3 Copyright (C) 2018-2021 Free Software Foundation, Inc.
3 Copyright (C) 2018-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1996-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1996-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h+4-48
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2005-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2005-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
......@@ -21,7 +21,8 @@
2121
2222#include <sysdeps/unix/sysdep.h>
2323#include <sysdeps/aarch64/sysdep.h>
24#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
24#include <sysdeps/unix/sysdep.h>
25#include <sysdeps/unix/sysv/linux/sysdep.h>
2526
2627/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
2728#include <dl-sysdep.h>
......@@ -164,7 +165,7 @@
164165# define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
165166# define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
166167
167# define SINGLE_THREAD_BY_GLOBAL 1
168# define HAVE_CLONE3_WRAPPER 1
168169
169170# undef INTERNAL_SYSCALL_RAW
170171# define INTERNAL_SYSCALL_RAW(name, nr, args...) \
......@@ -235,49 +236,4 @@
235236
236237#endif /* __ASSEMBLER__ */
237238
238/* Pointer mangling is supported for AArch64. */
239#if (IS_IN (rtld) \
240 || (!defined SHARED && (IS_IN (libc) \
241 || IS_IN (libpthread))))
242# ifdef __ASSEMBLER__
243/* Note, dst, src, guard, and tmp are all register numbers rather than
244 register names so they will work with both ILP32 and LP64. */
245# define PTR_MANGLE(dst, src, guard, tmp) \
246 LDST_PCREL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local)); \
247 PTR_MANGLE2 (dst, src, guard)
248/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */
249# define PTR_MANGLE2(dst, src, guard)\
250 eor x##dst, x##src, x##guard
251# define PTR_DEMANGLE(dst, src, guard, tmp)\
252 PTR_MANGLE (dst, src, guard, tmp)
253# define PTR_DEMANGLE2(dst, src, guard)\
254 PTR_MANGLE2 (dst, src, guard)
255# else
256extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
257# define PTR_MANGLE(var) \
258 (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
259# define PTR_DEMANGLE(var) PTR_MANGLE (var)
260# endif
261#else
262# ifdef __ASSEMBLER__
263/* Note, dst, src, guard, and tmp are all register numbers rather than
264 register names so they will work with both ILP32 and LP64. */
265# define PTR_MANGLE(dst, src, guard, tmp) \
266 LDST_GLOBAL (ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard)); \
267 PTR_MANGLE2 (dst, src, guard)
268/* Use PTR_MANGLE2 for efficiency if guard is already loaded. */
269# define PTR_MANGLE2(dst, src, guard)\
270 eor x##dst, x##src, x##guard
271# define PTR_DEMANGLE(dst, src, guard, tmp)\
272 PTR_MANGLE (dst, src, guard, tmp)
273# define PTR_DEMANGLE2(dst, src, guard)\
274 PTR_MANGLE2 (dst, src, guard)
275# else
276extern uintptr_t __pointer_chk_guard attribute_relro;
277# define PTR_MANGLE(var) \
278 (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
279# define PTR_DEMANGLE(var) PTR_MANGLE (var)
280# endif
281#endif
282
283239#endif /* linux/aarch64/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h+1-1
......@@ -1,5 +1,5 @@
11/* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2010-2021 Free Software Foundation, Inc.
3 Copyright (C) 2010-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/alpha/sysdep.h+1-44
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
......@@ -33,8 +32,6 @@
3332#undef SYS_ify
3433#define SYS_ify(syscall_name) __NR_##syscall_name
3534
36#define SINGLE_THREAD_BY_GLOBAL 1
37
3835#ifdef __ASSEMBLER__
3936#include <asm/pal.h>
4037#include <alpha/regdef.h>
......@@ -316,44 +313,4 @@ __LABEL(name) \
316313})
317314#endif /* ASSEMBLER */
318315
319/* Pointer mangling support. Note that tls access is slow enough that
320 we don't deoptimize things by placing the pointer check value there. */
321
322#ifdef __ASSEMBLER__
323# if IS_IN (rtld)
324# define PTR_MANGLE(dst, src, tmp) \
325 ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
326 ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
327 xor src, tmp, dst
328# define PTR_MANGLE2(dst, src, tmp) \
329 xor src, tmp, dst
330# elif defined SHARED
331# define PTR_MANGLE(dst, src, tmp) \
332 ldq tmp, __pointer_chk_guard; \
333 xor src, tmp, dst
334# else
335# define PTR_MANGLE(dst, src, tmp) \
336 ldq tmp, __pointer_chk_guard_local; \
337 xor src, tmp, dst
338# endif
339# define PTR_MANGLE2(dst, src, tmp) \
340 xor src, tmp, dst
341# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
342# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
343#else
344# include <stdint.h>
345# if (IS_IN (rtld) \
346 || (!defined SHARED && (IS_IN (libc) \
347 || IS_IN (libpthread))))
348extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
349# define PTR_MANGLE(var) \
350 (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
351# else
352extern uintptr_t __pointer_chk_guard attribute_relro;
353# define PTR_MANGLE(var) \
354 (var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
355# endif
356# define PTR_DEMANGLE(var) PTR_MANGLE(var)
357#endif /* ASSEMBLER */
358
359316#endif /* _LINUX_ALPHA_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h+8-10
......@@ -1,5 +1,5 @@
11/* Assembler macros for ARC.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -20,7 +20,9 @@
2020#define _LINUX_ARC_SYSDEP_H 1
2121
2222#include <sysdeps/arc/sysdep.h>
23#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
23#include <bits/wordsize.h>
24#include <sysdeps/unix/sysdep.h>
25#include <sysdeps/unix/sysv/linux/sysdep.h>
2426
2527/* "workarounds" for generic code needing to handle 64-bit time_t. */
2628
......@@ -132,8 +134,6 @@ L (call_syscall_err): ASM_LINE_SEP \
132134
133135#else /* !__ASSEMBLER__ */
134136
135# define SINGLE_THREAD_BY_GLOBAL 1
136
137137# if IS_IN (libc)
138138extern long int __syscall_error (long int);
139139hidden_proto (__syscall_error)
......@@ -141,6 +141,8 @@ hidden_proto (__syscall_error)
141141
142142# define ARC_TRAP_INSN "trap_s 0 \n\t"
143143
144# define HAVE_CLONE3_WRAPPER 1
145
144146# undef INTERNAL_SYSCALL_NCS
145147# define INTERNAL_SYSCALL_NCS(number, nr_args, args...) \
146148 ({ \
......@@ -180,11 +182,11 @@ hidden_proto (__syscall_error)
180182 __ret = (long int) (arg1); \
181183 LOAD_ARGS_0 (nm, arg1)
182184
183/* Note that the use of _tmpX might look superflous, however it is needed
185/* Note that the use of _tmpX might look superfluous, however it is needed
184186 to ensure that register variables are not clobbered if arg happens to be
185187 a function call itself. e.g. sched_setaffinity() calling getpid() for arg2
186188 Also this specific order of recursive calling is important to segregate
187 the tmp args evaluation (function call case described above) and assigment
189 the tmp args evaluation (function call case described above) and assignment
188190 of register variables. */
189191
190192# define LOAD_ARGS_2(nm, arg1, arg2) \
......@@ -217,10 +219,6 @@ hidden_proto (__syscall_error)
217219 LOAD_ARGS_6 (nm, arg1, arg2, arg3, arg4, arg5, arg6) \
218220 register long int _arg7 __asm__ ("r6") = _tmp7;
219221
220/* Pointer mangling not yet supported. */
221# define PTR_MANGLE(var) (void) (var)
222# define PTR_DEMANGLE(var) (void) (var)
223
224222# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
225223# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
226224
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2006-2021 Free Software Foundation, Inc.
3 Copyright (C) 2006-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1996-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1996-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h+1-5
......@@ -1,7 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
4 ARM changes by Philip Blundell, <pjb27@cam.ac.uk>, May 1997.
53
64 The GNU C Library is free software; you can redistribute it and/or
75 modify it under the terms of the GNU Lesser General Public
......@@ -410,8 +408,6 @@ __local_syscall_error: \
410408#define INTERNAL_SYSCALL_NCS(number, nr, args...) \
411409 INTERNAL_SYSCALL_RAW (number, nr, args)
412410
413#define SINGLE_THREAD_BY_GLOBAL 1
414
415411#endif /* __ASSEMBLER__ */
416412
417413#endif /* linux/arm/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h+2-2
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -25,7 +25,7 @@
2525
2626struct timex
2727{
28# ifdef __USE_TIME_BITS64
28# if defined __USE_TIME_BITS64 || (__TIMESIZE == 64 && __WORDSIZE == 32)
2929 unsigned int modes; /* mode selector */
3030 int :32; /* pad */
3131 long long offset; /* time offset (usec) */
lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h+1-1
......@@ -1,5 +1,5 @@
11/* Internal definitions for stat functions. Linux/csky.
2 Copyright (C) 2011-2021 Free Software Foundation, Inc.
2 Copyright (C) 2011-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h+2-48
......@@ -1,5 +1,5 @@
11/* Assembly macros for C-SKY.
2 Copyright (C) 2018-2021 Free Software Foundation, Inc.
2 Copyright (C) 2018-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -20,9 +20,9 @@
2020#define _LINUX_CSKY_SYSDEP_H 1
2121
2222/* There is some commonality. */
23#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
2423#include <sysdeps/unix/sysv/linux/sysdep.h>
2524#include <sysdeps/csky/sysdep.h>
25#include <sysdeps/unix/sysdep.h>
2626
2727/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
2828#include <dl-sysdep.h>
......@@ -466,50 +466,4 @@ __local_syscall_error: \
466466
467467#endif /* __ASSEMBLER__ */
468468
469/* Pointer mangling support. */
470#if (IS_IN (rtld) \
471 || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
472# ifdef __ASSEMBLER__
473# define PTR_MANGLE(dst, src, guard) \
474 grs t0, 1f; \
4751: \
476 lrw guard, 1b@GOTPC; \
477 addu t0, guard; \
478 lrw guard, __pointer_chk_guard_local@GOT; \
479 ldr.w guard, (t0, guard << 0); \
480 ldw guard, (guard, 0); \
481 xor dst, src, guard;
482# define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard)
483# define PTR_MANGLE2(dst, src, guard) \
484 xor dst, src, guard
485# define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard)
486# else
487extern uintptr_t __pointer_chk_guard_local;
488# define PTR_MANGLE(var) \
489 (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
490# define PTR_DEMANGLE(var) PTR_MANGLE (var)
491# endif
492#else
493# ifdef __ASSEMBLER__
494# define PTR_MANGLE(dst, src, guard) \
495 grs t0, 1f; \
4961: \
497 lrw guard, 1b@GOTPC; \
498 addu t0, guard; \
499 lrw guard, __pointer_chk_guard@GOT; \
500 ldr.w guard, (t0, guard << 0); \
501 ldw guard, (guard, 0); \
502 xor dst, src, guard;
503# define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard)
504# define PTR_MANGLE2(dst, src, guard) \
505 xor dst, src, guard
506# define PTR_DEMANGLE2(dst, src, guard) PTR_MANGLE2 (dst, src, guard)
507# else
508extern uintptr_t __pointer_chk_guard;
509# define PTR_MANGLE(var) \
510 (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
511# define PTR_DEMANGLE(var) PTR_MANGLE (var)
512# endif
513#endif
514
515469#endif /* linux/csky/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h+1-8
......@@ -1,5 +1,5 @@
11/* System-specific settings for dynamic linker code. Linux version.
2 Copyright (C) 2005-2021 Free Software Foundation, Inc.
2 Copyright (C) 2005-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -24,10 +24,3 @@
2424 we aren't making direct use of it. So enable this across the board. */
2525
2626#define NEED_DL_SYSINFO_DSO 1
27
28
29#ifndef __ASSEMBLER__
30/* Get version of the OS. */
31extern int _dl_discover_osversion (void) attribute_hidden;
32# define HAVE_DL_DISCOVER_OSVERSION 1
33#endif
lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c+1-1
......@@ -1,5 +1,5 @@
11/* Get file status. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c+1-1
......@@ -1,5 +1,5 @@
11/* Get file status. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c+1-23
......@@ -1,5 +1,5 @@
11/* Get file status. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -16,33 +16,11 @@
1616 License along with the GNU C Library; if not, see
1717 <https://www.gnu.org/licenses/>. */
1818
19#include <inttypes.h>
2019#include <sys/stat.h>
2120#include <kernel_stat.h>
2221#include <sysdep.h>
23#include <string.h>
2422
2523#if !XSTAT_IS_XSTAT64
26# include <kstat_cp.h>
27
28static inline bool
29in_time_t_range (__time64_t t)
30{
31 time_t s = t;
32 return s == t;
33}
34
35static inline struct timespec
36valid_timespec64_to_timespec (const struct __timespec64 ts64)
37{
38 struct timespec ts;
39
40 ts.tv_sec = (time_t) ts64.tv_sec;
41 ts.tv_nsec = ts64.tv_nsec;
42
43 return ts;
44}
45
4624int
4725__fstatat (int fd, const char *file, struct stat *buf, int flag)
4826{
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c+15-22
......@@ -1,5 +1,5 @@
11/* Get file status. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -18,7 +18,6 @@
1818
1919#define __fstatat __redirect___fstatat
2020#define fstatat __redirect_fstatat
21#include <inttypes.h>
2221#include <sys/stat.h>
2322#include <fcntl.h>
2423#include <string.h>
......@@ -41,6 +40,12 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
4140 "__blkcnt_t and __blkcnt64_t must match");
4241#endif
4342
43#if (__WORDSIZE == 32 \
44 && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
45 || defined STAT_HAS_TIME32 \
46 || (!defined __NR_newfstatat && !defined __NR_fstatat64)
47# define FSTATAT_USE_STATX 1
48
4449static inline int
4550fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
4651 int flag)
......@@ -54,8 +59,8 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
5459 return r;
5560
5661 *buf = (struct __stat64_t64) {
57 .st_dev = gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor),
58 .st_rdev = gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor),
62 .st_dev = __gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor),
63 .st_rdev = __gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor),
5964 .st_ino = tmp.stx_ino,
6065 .st_mode = tmp.stx_mode,
6166 .st_nlink = tmp.stx_nlink,
......@@ -74,18 +79,13 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
7479
7580 return r;
7681}
82#else
83# define FSTATAT_USE_STATX 0
84#endif
7785
78static inline struct __timespec64
79valid_timespec_to_timespec64 (const struct timespec ts)
80{
81 struct __timespec64 ts64;
82
83 ts64.tv_sec = ts.tv_sec;
84 ts64.tv_nsec = ts.tv_nsec;
85
86 return ts64;
87}
88
86/* Only statx supports 64-bit timestamps for 32-bit architectures with
87 __ASSUME_STATX, so there is no point in building the fallback. */
88#if !FSTATAT_USE_STATX || (FSTATAT_USE_STATX && !defined __ASSUME_STATX)
8989static inline int
9090fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,
9191 int flag)
......@@ -146,13 +146,6 @@ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,
146146
147147 return r;
148148}
149
150#if (__WORDSIZE == 32 \
151 && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
152 || defined STAT_HAS_TIME32
153# define FSTATAT_USE_STATX 1
154#else
155# define FSTATAT_USE_STATX 0
156149#endif
157150
158151int
lib/libc/glibc/sysdeps/unix/sysv/linux/generic/bits/typesizes.h deleted-108
......@@ -1,108 +0,0 @@
1/* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI.
2 Copyright (C) 2011-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library. If not, see
18 <https://www.gnu.org/licenses/>. */
19
20#ifndef _BITS_TYPES_H
21# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
22#endif
23
24#ifndef _BITS_TYPESIZES_H
25#define _BITS_TYPESIZES_H 1
26
27/* See <bits/types.h> for the meaning of these macros. This file exists so
28 that <bits/types.h> need not vary across different GNU platforms. */
29#if __TIMESIZE == 64 && __WORDSIZE == 32
30/* These are the "new" y2038 types defined for architectures added after
31 the 5.1 kernel. */
32# define __INO_T_TYPE __UQUAD_TYPE
33# define __OFF_T_TYPE __SQUAD_TYPE
34# define __RLIM_T_TYPE __UQUAD_TYPE
35# define __BLKCNT_T_TYPE __SQUAD_TYPE
36# define __FSBLKCNT_T_TYPE __UQUAD_TYPE
37# define __FSFILCNT_T_TYPE __UQUAD_TYPE
38# define __TIME_T_TYPE __SQUAD_TYPE
39# define __SUSECONDS_T_TYPE __SQUAD_TYPE
40#else
41# define __INO_T_TYPE __ULONGWORD_TYPE
42# define __OFF_T_TYPE __SLONGWORD_TYPE
43# define __RLIM_T_TYPE __ULONGWORD_TYPE
44# define __BLKCNT_T_TYPE __SLONGWORD_TYPE
45# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
46# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
47# define __TIME_T_TYPE __SLONGWORD_TYPE
48# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
49#endif
50
51#define __DEV_T_TYPE __UQUAD_TYPE
52#define __UID_T_TYPE __U32_TYPE
53#define __GID_T_TYPE __U32_TYPE
54#define __INO64_T_TYPE __UQUAD_TYPE
55#define __MODE_T_TYPE __U32_TYPE
56#define __NLINK_T_TYPE __U32_TYPE
57#define __OFF64_T_TYPE __SQUAD_TYPE
58#define __PID_T_TYPE __S32_TYPE
59#define __RLIM64_T_TYPE __UQUAD_TYPE
60#define __BLKCNT64_T_TYPE __SQUAD_TYPE
61#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
62#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
63#define __FSWORD_T_TYPE __SWORD_TYPE
64#define __ID_T_TYPE __U32_TYPE
65#define __CLOCK_T_TYPE __SLONGWORD_TYPE
66#define __USECONDS_T_TYPE __U32_TYPE
67#define __SUSECONDS64_T_TYPE __SQUAD_TYPE
68#define __DADDR_T_TYPE __S32_TYPE
69#define __KEY_T_TYPE __S32_TYPE
70#define __CLOCKID_T_TYPE __S32_TYPE
71#define __TIMER_T_TYPE void *
72#define __BLKSIZE_T_TYPE __S32_TYPE
73#define __FSID_T_TYPE struct { int __val[2]; }
74#define __SSIZE_T_TYPE __SWORD_TYPE
75#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
76#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
77#define __CPU_MASK_TYPE __ULONGWORD_TYPE
78
79#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32)
80/* Tell the libc code that off_t and off64_t are actually the same type
81 for all ABI purposes, even if possibly expressed as different base types
82 for C type-checking purposes. */
83# define __OFF_T_MATCHES_OFF64_T 1
84
85/* Same for ino_t and ino64_t. */
86# define __INO_T_MATCHES_INO64_T 1
87
88/* And for __rlim_t and __rlim64_t. */
89# define __RLIM_T_MATCHES_RLIM64_T 1
90
91/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
92# define __STATFS_MATCHES_STATFS64 1
93
94/* And for getitimer, setitimer and rusage */
95# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64)
96#else
97# define __RLIM_T_MATCHES_RLIM64_T 0
98
99# define __STATFS_MATCHES_STATFS64 0
100
101# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
102#endif
103
104/* Number of descriptors that can fit in an `fd_set'. */
105#define __FD_SETSIZE 1024
106
107
108#endif /* bits/typesizes.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/generic/sysdep.h deleted-27
......@@ -1,27 +0,0 @@
1/* Copyright (C) 2011-2021 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include <bits/wordsize.h>
20#include <kernel-features.h>
21#include <sysdeps/unix/sysdep.h>
22#include <sysdeps/unix/sysv/linux/sysdep.h>
23
24/* Provide the common name to allow more code reuse. */
25#ifdef __NR_llseek
26# define __NR__llseek __NR_llseek
27#endif
lib/libc/glibc/sysdeps/unix/sysv/linux/generic/xstatver.h deleted-10
......@@ -1,10 +0,0 @@
1/* Versions of the 'struct stat' data structure used in compatibility xstat
2 functions. */
3#define _STAT_VER_KERNEL 0
4#define _STAT_VER_LINUX 0
5#define _STAT_VER _STAT_VER_KERNEL
6
7/* Versions of the 'xmknod' interface used in compatibility xmknod
8 functions. */
9#define _MKNOD_VER_LINUX 0
10#define _MKNOD_VER _MKNOD_VER_LINUX
lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/kernel-features.h+4-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2006-2021 Free Software Foundation, Inc.
3 Copyright (C) 2006-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -30,3 +30,6 @@
3030
3131#undef __ASSUME_CLONE_DEFAULT
3232#define __ASSUME_CLONE_BACKWARDS 1
33
34/* QEMU does not support set_robust_list. */
35#undef __ASSUME_SET_ROBUST_LIST
lib/libc/glibc/sysdeps/unix/sysv/linux/hppa/sysdep.h+4-12
......@@ -1,8 +1,6 @@
11/* Assembler macros for PA-RISC.
2 Copyright (C) 1999-2021 Free Software Foundation, Inc.
2 Copyright (C) 1999-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
5 Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000.
64
75 The GNU C Library is free software; you can redistribute it and/or
86 modify it under the terms of the GNU Lesser General Public
......@@ -55,7 +53,7 @@
5553#define LOAD_PIC(LREG) \
5654 copy LREG , %r19
5755/* Inline assembly defines */
58#define TREG_ASM "%r4" /* Cant clobber r3, it holds framemarker */
56#define TREG_ASM "%r4" /* Can't clobber r3, it holds framemarker */
5957#define SAVE_ASM_PIC " copy %%r19, %" TREG_ASM "\n"
6058#define LOAD_ASM_PIC " copy %" TREG_ASM ", %%r19\n"
6159#define CLOB_TREG TREG_ASM ,
......@@ -136,7 +134,7 @@
136134 /* SAVE_RP says we do */ ASM_LINE_SEP \
137135 stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \
138136 .cfi_offset 2, -20 ASM_LINE_SEP \
139 /*FIXME: Call mcount? (carefull with stack!) */
137 /*FIXME: Call mcount? (careful with stack!) */
140138
141139/* Some syscall wrappers do not call other functions, and
142140 hence are classified as leaf, so add NO_CALLS for gdb */
......@@ -153,7 +151,7 @@
153151 /* SAVE_RP says we do */ ASM_LINE_SEP \
154152 stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \
155153 .cfi_offset 2, -20 ASM_LINE_SEP \
156 /*FIXME: Call mcount? (carefull with stack!) */
154 /*FIXME: Call mcount? (careful with stack!) */
157155
158156#undef END
159157#define END(name) \
......@@ -472,10 +470,4 @@ L(pre_end): ASM_LINE_SEP \
472470
473471#endif /* __ASSEMBLER__ */
474472
475/* Pointer mangling is not yet supported for HPPA. */
476#define PTR_MANGLE(var) (void) (var)
477#define PTR_DEMANGLE(var) (void) (var)
478
479#define SINGLE_THREAD_BY_GLOBAL 1
480
481473#endif /* _LINUX_HPPA_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* System-specific settings for dynamic linker code. i386 version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h+9-12
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. i386 version.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -17,21 +17,11 @@
1717 License along with the GNU C Library; if not, see
1818 <https://www.gnu.org/licenses/>. */
1919
20/* Direct socketcalls available with kernel 4.3. */
21#if __LINUX_KERNEL_VERSION >= 0x040300
22# define __ASSUME_SOCKET_SYSCALL 1
23# define __ASSUME_SOCKETPAIR_SYSCALL 1
24# define __ASSUME_BIND_SYSCALL 1
25# define __ASSUME_LISTEN_SYSCALL 1
26# define __ASSUME_GETSOCKNAME_SYSCALL 1
27# define __ASSUME_GETPEERNAME_SYSCALL 1
28# define __ASSUME_SHUTDOWN_SYSCALL 1
29#endif
30
3120#include_next <kernel-features.h>
3221
3322#undef __ASSUME_ACCEPT_SYSCALL
3423
24/* Direct socketcalls available with kernel 4.3. */
3525#if __LINUX_KERNEL_VERSION < 0x040300
3626# undef __ASSUME_ACCEPT4_SYSCALL
3727# undef __ASSUME_SENDMSG_SYSCALL
......@@ -41,6 +31,13 @@
4131# undef __ASSUME_SENDTO_SYSCALL
4232# undef __ASSUME_GETSOCKOPT_SYSCALL
4333# undef __ASSUME_SETSOCKOPT_SYSCALL
34# undef __ASSUME_BIND_SYSCALL
35# undef __ASSUME_SOCKET_SYSCALL
36# undef __ASSUME_SOCKETPAIR_SYSCALL
37# undef __ASSUME_LISTEN_SYSCALL
38# undef __ASSUME_SHUTDOWN_SYSCALL
39# undef __ASSUME_GETSOCKNAME_SYSCALL
40# undef __ASSUME_GETPEERNAME_SYSCALL
4441#endif
4542
4643/* i686 only supports ipc syscall before 5.1. */
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h+38-226
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
......@@ -43,13 +42,13 @@
4342# endif
4443#endif
4544
46/* Since GCC 5 and above can properly spill %ebx with PIC when needed,
47 we can inline syscalls with 6 arguments if GCC 5 or above is used
48 to compile glibc. Disable GCC 5 optimization when compiling for
49 profiling or when -fno-omit-frame-pointer is used since asm ("ebp")
50 can't be used to put the 6th argument in %ebp for syscall. */
51#if !defined PROF && CAN_USE_REGISTER_ASM_EBP
52# define OPTIMIZE_FOR_GCC_5
45#if !I386_USE_SYSENTER && IS_IN (libc) && !defined SHARED
46/* Inside static libc, we have two versions. For compilation units
47 with !I386_USE_SYSENTER, the vDSO entry mechanism cannot be
48 used. */
49# define I386_DO_SYSCALL_STRING "__libc_do_syscall_int80"
50#else
51# define I386_DO_SYSCALL_STRING "__libc_do_syscall"
5352#endif
5453
5554#ifdef __ASSEMBLER__
......@@ -62,7 +61,7 @@
6261 might return a large offset. Therefore we must not anymore test
6362 for < 0, but test for a real error by making sure the value in %eax
6463 is a real error number. Linus said he will make sure the no syscall
65 returns a value in -1 .. -4095 as a valid result so we can savely
64 returns a value in -1 .. -4095 as a valid result so we can safely
6665 test with -4095. */
6766
6867/* We don't want the label for the error handle to be global when we define
......@@ -239,36 +238,6 @@
239238extern int __syscall_error (int)
240239 attribute_hidden __attribute__ ((__regparm__ (1)));
241240
242#ifndef OPTIMIZE_FOR_GCC_5
243/* We need some help from the assembler to generate optimal code. We
244 define some macros here which later will be used. */
245asm (".L__X'%ebx = 1\n\t"
246 ".L__X'%ecx = 2\n\t"
247 ".L__X'%edx = 2\n\t"
248 ".L__X'%eax = 3\n\t"
249 ".L__X'%esi = 3\n\t"
250 ".L__X'%edi = 3\n\t"
251 ".L__X'%ebp = 3\n\t"
252 ".L__X'%esp = 3\n\t"
253 ".macro bpushl name reg\n\t"
254 ".if 1 - \\name\n\t"
255 ".if 2 - \\name\n\t"
256 "error\n\t"
257 ".else\n\t"
258 "xchgl \\reg, %ebx\n\t"
259 ".endif\n\t"
260 ".endif\n\t"
261 ".endm\n\t"
262 ".macro bpopl name reg\n\t"
263 ".if 1 - \\name\n\t"
264 ".if 2 - \\name\n\t"
265 "error\n\t"
266 ".else\n\t"
267 "xchgl \\reg, %ebx\n\t"
268 ".endif\n\t"
269 ".endif\n\t"
270 ".endm\n\t");
271
272241/* Six-argument syscalls use an out-of-line helper, because an inline
273242 asm using all registers apart from %esp cannot work reliably and
274243 the assembler does not support describing an asm that saves and
......@@ -279,7 +248,6 @@ struct libc_do_syscall_args
279248{
280249 int ebx, edi, ebp;
281250};
282#endif
283251
284252# define VDSO_NAME "LINUX_2.6"
285253# define VDSO_HASH 61765110
......@@ -332,14 +300,8 @@ struct libc_do_syscall_args
332300
333301/* Each object using 6-argument inline syscalls must include a
334302 definition of __libc_do_syscall. */
335#ifdef OPTIMIZE_FOR_GCC_5
336# define INTERNAL_SYSCALL_MAIN_6(name, args...) \
337 INTERNAL_SYSCALL_MAIN_INLINE(name, 6, args)
338# define INTERNAL_SYSCALL_MAIN_NCS_6(name, args...) \
339 INTERNAL_SYSCALL_MAIN_NCS(name, 6, args)
340#else /* GCC 5 */
341# define INTERNAL_SYSCALL_MAIN_6(name, arg1, arg2, arg3, \
342 arg4, arg5, arg6) \
303#define INTERNAL_SYSCALL_MAIN_6(name, arg1, arg2, arg3, \
304 arg4, arg5, arg6) \
343305 struct libc_do_syscall_args _xv = \
344306 { \
345307 (int) (arg1), \
......@@ -348,12 +310,12 @@ struct libc_do_syscall_args
348310 }; \
349311 asm volatile ( \
350312 "movl %1, %%eax\n\t" \
351 "call __libc_do_syscall" \
313 "call " I386_DO_SYSCALL_STRING \
352314 : "=a" (resultvar) \
353315 : "i" (__NR_##name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \
354316 : "memory", "cc")
355# define INTERNAL_SYSCALL_MAIN_NCS_6(name, arg1, arg2, arg3, \
356 arg4, arg5, arg6) \
317#define INTERNAL_SYSCALL_MAIN_NCS_6(name, arg1, arg2, arg3, \
318 arg4, arg5, arg6) \
357319 struct libc_do_syscall_args _xv = \
358320 { \
359321 (int) (arg1), \
......@@ -362,11 +324,10 @@ struct libc_do_syscall_args
362324 }; \
363325 asm volatile ( \
364326 "movl %1, %%eax\n\t" \
365 "call __libc_do_syscall" \
327 "call " I386_DO_SYSCALL_STRING \
366328 : "=a" (resultvar) \
367329 : "a" (name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \
368330 : "memory", "cc")
369#endif /* GCC 5 */
370331
371332#define INTERNAL_SYSCALL(name, nr, args...) \
372333 ({ \
......@@ -380,193 +341,72 @@ struct libc_do_syscall_args
380341 (int) resultvar; })
381342
382343#if I386_USE_SYSENTER
383# ifdef OPTIMIZE_FOR_GCC_5
384# ifdef PIC
385# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
344# ifdef PIC
345# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
386346 LOADREGS_##nr(args) \
387347 asm volatile ( \
388348 "call *%%gs:%P2" \
389349 : "=a" (resultvar) \
390350 : "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \
391351 ASMARGS_##nr(args) : "memory", "cc")
392# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
352# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
393353 LOADREGS_##nr(args) \
394354 asm volatile ( \
395355 "call *%%gs:%P2" \
396356 : "=a" (resultvar) \
397357 : "a" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
398358 ASMARGS_##nr(args) : "memory", "cc")
399# else
400# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
359# else /* I386_USE_SYSENTER && !PIC */
360# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
401361 LOADREGS_##nr(args) \
402362 asm volatile ( \
403363 "call *_dl_sysinfo" \
404364 : "=a" (resultvar) \
405365 : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc")
406# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
366# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
407367 LOADREGS_##nr(args) \
408368 asm volatile ( \
409369 "call *_dl_sysinfo" \
410370 : "=a" (resultvar) \
411371 : "a" (name) ASMARGS_##nr(args) : "memory", "cc")
412# endif
413# else /* GCC 5 */
414# ifdef PIC
415# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
416 EXTRAVAR_##nr \
417 asm volatile ( \
418 LOADARGS_##nr \
419 "movl %1, %%eax\n\t" \
420 "call *%%gs:%P2\n\t" \
421 RESTOREARGS_##nr \
422 : "=a" (resultvar) \
423 : "i" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \
424 ASMFMT_##nr(args) : "memory", "cc")
425# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
426 EXTRAVAR_##nr \
427 asm volatile ( \
428 LOADARGS_##nr \
429 "call *%%gs:%P2\n\t" \
430 RESTOREARGS_##nr \
431 : "=a" (resultvar) \
432 : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
433 ASMFMT_##nr(args) : "memory", "cc")
434# else
435# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
436 EXTRAVAR_##nr \
437 asm volatile ( \
438 LOADARGS_##nr \
439 "movl %1, %%eax\n\t" \
440 "call *_dl_sysinfo\n\t" \
441 RESTOREARGS_##nr \
442 : "=a" (resultvar) \
443 : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc")
444# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
445 EXTRAVAR_##nr \
446 asm volatile ( \
447 LOADARGS_##nr \
448 "call *_dl_sysinfo\n\t" \
449 RESTOREARGS_##nr \
450 : "=a" (resultvar) \
451 : "0" (name) ASMFMT_##nr(args) : "memory", "cc")
452# endif
453# endif /* GCC 5 */
454#else
455# ifdef OPTIMIZE_FOR_GCC_5
456# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
372# endif /* I386_USE_SYSENTER && !PIC */
373#else /* !I386_USE_SYSENTER */
374# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
457375 LOADREGS_##nr(args) \
458376 asm volatile ( \
459377 "int $0x80" \
460378 : "=a" (resultvar) \
461379 : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc")
462# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
380# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
463381 LOADREGS_##nr(args) \
464382 asm volatile ( \
465383 "int $0x80" \
466384 : "=a" (resultvar) \
467385 : "a" (name) ASMARGS_##nr(args) : "memory", "cc")
468# else /* GCC 5 */
469# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \
470 EXTRAVAR_##nr \
471 asm volatile ( \
472 LOADARGS_##nr \
473 "movl %1, %%eax\n\t" \
474 "int $0x80\n\t" \
475 RESTOREARGS_##nr \
476 : "=a" (resultvar) \
477 : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc")
478# define INTERNAL_SYSCALL_MAIN_NCS(name, nr, args...) \
479 EXTRAVAR_##nr \
480 asm volatile ( \
481 LOADARGS_##nr \
482 "int $0x80\n\t" \
483 RESTOREARGS_##nr \
484 : "=a" (resultvar) \
485 : "0" (name) ASMFMT_##nr(args) : "memory", "cc")
486# endif /* GCC 5 */
487#endif
488
489#define LOADARGS_0
490#ifdef __PIC__
491# if I386_USE_SYSENTER && defined PIC
492# define LOADARGS_1 \
493 "bpushl .L__X'%k3, %k3\n\t"
494# define LOADARGS_5 \
495 "movl %%ebx, %4\n\t" \
496 "movl %3, %%ebx\n\t"
497# else
498# define LOADARGS_1 \
499 "bpushl .L__X'%k2, %k2\n\t"
500# define LOADARGS_5 \
501 "movl %%ebx, %3\n\t" \
502 "movl %2, %%ebx\n\t"
503# endif
504# define LOADARGS_2 LOADARGS_1
505# define LOADARGS_3 \
506 "xchgl %%ebx, %%edi\n\t"
507# define LOADARGS_4 LOADARGS_3
508#else
509# define LOADARGS_1
510# define LOADARGS_2
511# define LOADARGS_3
512# define LOADARGS_4
513# define LOADARGS_5
514#endif
515
516#define RESTOREARGS_0
517#ifdef __PIC__
518# if I386_USE_SYSENTER && defined PIC
519# define RESTOREARGS_1 \
520 "bpopl .L__X'%k3, %k3\n\t"
521# define RESTOREARGS_5 \
522 "movl %4, %%ebx"
523# else
524# define RESTOREARGS_1 \
525 "bpopl .L__X'%k2, %k2\n\t"
526# define RESTOREARGS_5 \
527 "movl %3, %%ebx"
528# endif
529# define RESTOREARGS_2 RESTOREARGS_1
530# define RESTOREARGS_3 \
531 "xchgl %%edi, %%ebx\n\t"
532# define RESTOREARGS_4 RESTOREARGS_3
533#else
534# define RESTOREARGS_1
535# define RESTOREARGS_2
536# define RESTOREARGS_3
537# define RESTOREARGS_4
538# define RESTOREARGS_5
539#endif
386#endif /* !I386_USE_SYSENTER */
540387
541#ifdef OPTIMIZE_FOR_GCC_5
542# define LOADREGS_0()
543# define ASMARGS_0()
544# define LOADREGS_1(arg1) \
388#define LOADREGS_0()
389#define ASMARGS_0()
390#define LOADREGS_1(arg1) \
545391 LOADREGS_0 ()
546# define ASMARGS_1(arg1) \
392#define ASMARGS_1(arg1) \
547393 ASMARGS_0 (), "b" ((unsigned int) (arg1))
548# define LOADREGS_2(arg1, arg2) \
394#define LOADREGS_2(arg1, arg2) \
549395 LOADREGS_1 (arg1)
550# define ASMARGS_2(arg1, arg2) \
396#define ASMARGS_2(arg1, arg2) \
551397 ASMARGS_1 (arg1), "c" ((unsigned int) (arg2))
552# define LOADREGS_3(arg1, arg2, arg3) \
398#define LOADREGS_3(arg1, arg2, arg3) \
553399 LOADREGS_2 (arg1, arg2)
554# define ASMARGS_3(arg1, arg2, arg3) \
400#define ASMARGS_3(arg1, arg2, arg3) \
555401 ASMARGS_2 (arg1, arg2), "d" ((unsigned int) (arg3))
556# define LOADREGS_4(arg1, arg2, arg3, arg4) \
402#define LOADREGS_4(arg1, arg2, arg3, arg4) \
557403 LOADREGS_3 (arg1, arg2, arg3)
558# define ASMARGS_4(arg1, arg2, arg3, arg4) \
404#define ASMARGS_4(arg1, arg2, arg3, arg4) \
559405 ASMARGS_3 (arg1, arg2, arg3), "S" ((unsigned int) (arg4))
560# define LOADREGS_5(arg1, arg2, arg3, arg4, arg5) \
406#define LOADREGS_5(arg1, arg2, arg3, arg4, arg5) \
561407 LOADREGS_4 (arg1, arg2, arg3, arg4)
562# define ASMARGS_5(arg1, arg2, arg3, arg4, arg5) \
408#define ASMARGS_5(arg1, arg2, arg3, arg4, arg5) \
563409 ASMARGS_4 (arg1, arg2, arg3, arg4), "D" ((unsigned int) (arg5))
564# define LOADREGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
565 register unsigned int _a6 asm ("ebp") = (unsigned int) (arg6); \
566 LOADREGS_5 (arg1, arg2, arg3, arg4, arg5)
567# define ASMARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
568 ASMARGS_5 (arg1, arg2, arg3, arg4, arg5), "r" (_a6)
569#endif /* GCC 5 */
570410
571411#define ASMFMT_0()
572412#ifdef __PIC__
......@@ -606,34 +446,6 @@ struct libc_do_syscall_args
606446
607447#endif /* __ASSEMBLER__ */
608448
609
610/* Pointer mangling support. */
611#if IS_IN (rtld)
612/* We cannot use the thread descriptor because in ld.so we use setjmp
613 earlier than the descriptor is initialized. Using a global variable
614 is too complicated here since we have no PC-relative addressing mode. */
615#else
616# ifdef __ASSEMBLER__
617# define PTR_MANGLE(reg) xorl %gs:POINTER_GUARD, reg; \
618 roll $9, reg
619# define PTR_DEMANGLE(reg) rorl $9, reg; \
620 xorl %gs:POINTER_GUARD, reg
621# else
622# define PTR_MANGLE(var) asm ("xorl %%gs:%c2, %0\n" \
623 "roll $9, %0" \
624 : "=r" (var) \
625 : "0" (var), \
626 "i" (offsetof (tcbhead_t, \
627 pointer_guard)))
628# define PTR_DEMANGLE(var) asm ("rorl $9, %0\n" \
629 "xorl %%gs:%c2, %0" \
630 : "=r" (var) \
631 : "0" (var), \
632 "i" (offsetof (tcbhead_t, \
633 pointer_guard)))
634# endif
635#endif
636
637449/* Each shadow stack slot takes 4 bytes. Assuming that each stack
638450 frame takes 128 bytes, this is used to compute shadow stack size
639451 from stack size. */
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h+1-5
......@@ -1,5 +1,5 @@
11/* System-specific settings for dynamic linker code. IA-64 version.
2 Copyright (C) 2003-2021 Free Software Foundation, Inc.
2 Copyright (C) 2003-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -48,8 +48,4 @@ extern int _dl_sysinfo_break attribute_hidden;
4848 ".previous");
4949#endif
5050
51/* _dl_argv cannot be attribute_relro, because _dl_start_user
52 might write into it after _dl_start returns. */
53#define DL_ARGV_NOT_RELRO 1
54
5551#endif /* dl-sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2010-2021 Free Software Foundation, Inc.
3 Copyright (C) 2010-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/ia64/sysdep.h+15-34
......@@ -1,7 +1,5 @@
1/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1999-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
4 Based on code originally written by David Mosberger-Tang
53
64 The GNU C Library is free software; you can redistribute it and/or
75 modify it under the terms of the GNU Lesser General Public
......@@ -46,12 +44,15 @@
4644#undef SYS_ify
4745#define SYS_ify(syscall_name) __NR_##syscall_name
4846
49#if defined USE_DL_SYSINFO \
50 && (IS_IN (libc) \
51 || IS_IN (libpthread) || IS_IN (librt))
52# define IA64_USE_NEW_STUB
53#else
54# undef IA64_USE_NEW_STUB
47#ifndef IA64_USE_NEW_STUB
48# if defined USE_DL_SYSINFO && IS_IN (libc)
49# define IA64_USE_NEW_STUB 1
50# else
51# define IA64_USE_NEW_STUB 0
52# endif
53#endif
54#if IA64_USE_NEW_STUB && !USE_DL_SYSINFO
55# error IA64_USE_NEW_STUB needs USE_DL_SYSINFO
5556#endif
5657
5758#ifdef __ASSEMBLER__
......@@ -85,7 +86,7 @@
8586 a large offset. Therefore we must not anymore test for < 0, but test
8687 for a real error by making sure the value in %d0 is a real error
8788 number. Linus said he will make sure the no syscall returns a value
88 in -1 .. -4095 as a valid result so we can savely test with -4095. */
89 in -1 .. -4095 as a valid result so we can safely test with -4095. */
8990
9091/* We don't want the label for the error handler to be visible in the symbol
9192 table when we define it here. */
......@@ -103,7 +104,7 @@
103104 mov r15=num; \
104105 break __IA64_BREAK_SYSCALL
105106
106#ifdef IA64_USE_NEW_STUB
107#if IA64_USE_NEW_STUB
107108# ifdef SHARED
108109# define DO_CALL(num) \
109110 .prologue; \
......@@ -187,7 +188,7 @@
187188 (non-negative) errno on error or the return value on success.
188189 */
189190
190#ifdef IA64_USE_NEW_STUB
191#if IA64_USE_NEW_STUB
191192
192193# define INTERNAL_SYSCALL_NCS(name, nr, args...) \
193194({ \
......@@ -279,7 +280,7 @@
279280#define ASM_OUTARGS_5 ASM_OUTARGS_4, "=r" (_out4)
280281#define ASM_OUTARGS_6 ASM_OUTARGS_5, "=r" (_out5)
281282
282#ifdef IA64_USE_NEW_STUB
283#if IA64_USE_NEW_STUB
283284#define ASM_ARGS_0
284285#define ASM_ARGS_1 ASM_ARGS_0, "4" (_out0)
285286#define ASM_ARGS_2 ASM_ARGS_1, "5" (_out1)
......@@ -315,7 +316,7 @@
315316 /* Branch registers. */ \
316317 "b6"
317318
318#ifdef IA64_USE_NEW_STUB
319#if IA64_USE_NEW_STUB
319320# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON
320321#else
321322# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON , "b7"
......@@ -323,24 +324,4 @@
323324
324325#endif /* not __ASSEMBLER__ */
325326
326/* Pointer mangling support. */
327#if IS_IN (rtld)
328/* We cannot use the thread descriptor because in ld.so we use setjmp
329 earlier than the descriptor is initialized. */
330#else
331# ifdef __ASSEMBLER__
332# define PTR_MANGLE(reg, tmpreg) \
333 add tmpreg=-16,r13 \
334 ;; \
335 ld8 tmpreg=[tmpreg] \
336 ;; \
337 xor reg=reg, tmpreg
338# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
339# else
340# define PTR_MANGLE(var) \
341 (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
342# define PTR_DEMANGLE(var) PTR_MANGLE (var)
343# endif
344#endif
345
346327#endif /* linux/ia64/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h+6-6
......@@ -1,5 +1,5 @@
11/* Internal declarations for sys/timex.h.
2 Copyright (C) 2014-2021 Free Software Foundation, Inc.
2 Copyright (C) 2014-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -23,7 +23,7 @@
2323
2424# ifndef _ISOMAC
2525
26extern int __adjtimex (struct timex *__ntx);
26extern int __adjtimex (struct timex *__ntx) __nonnull ((1));
2727libc_hidden_proto (__adjtimex)
2828
2929# include <time.h>
......@@ -77,9 +77,9 @@ struct __timex64
7777 int :32;
7878 int :32;
7979};
80extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64);
80extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64) __nonnull((2));
8181libc_hidden_proto (__clock_adjtime64);
82extern int ___adjtimex64 (struct __timex64 *tx64);
82extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1));
8383libc_hidden_proto (___adjtimex64)
8484
8585struct __ntptimeval64
......@@ -94,9 +94,9 @@ struct __ntptimeval64
9494 long int __glibc_reserved3;
9595 long int __glibc_reserved4;
9696};
97extern int __ntp_gettime64 (struct __ntptimeval64 *ntv);
97extern int __ntp_gettime64 (struct __ntptimeval64 *ntv) __nonnull ((1));
9898libc_hidden_proto (__ntp_gettime64)
99extern int __ntp_gettimex64 (struct __ntptimeval64 *ntv);
99extern int __ntp_gettimex64 (struct __ntptimeval64 *ntv) __nonnull ((1));
100100libc_hidden_proto (__ntp_gettimex64)
101101
102102# endif
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h+33-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -79,6 +79,13 @@
7979#define __ASSUME_SENDMMSG_SYSCALL 1
8080#define __ASSUME_GETSOCKOPT_SYSCALL 1
8181#define __ASSUME_SETSOCKOPT_SYSCALL 1
82#define __ASSUME_BIND_SYSCALL 1
83#define __ASSUME_SOCKET_SYSCALL 1
84#define __ASSUME_SOCKETPAIR_SYSCALL 1
85#define __ASSUME_LISTEN_SYSCALL 1
86#define __ASSUME_SHUTDOWN_SYSCALL 1
87#define __ASSUME_GETSOCKNAME_SYSCALL 1
88#define __ASSUME_GETPEERNAME_SYSCALL 1
8289
8390/* Support for SysV IPC through wired syscalls. All supported architectures
8491 either support ipc syscall and/or all the ipc correspondent syscalls. */
......@@ -220,4 +227,29 @@
220227# define __ASSUME_FACCESSAT2 0
221228#endif
222229
230/* The close_range system call was introduced across all architectures
231 in Linux 5.9. */
232#if __LINUX_KERNEL_VERSION >= 0x050900
233# define __ASSUME_CLOSE_RANGE 1
234#else
235# define __ASSUME_CLOSE_RANGE 0
236#endif
237
238/* The FUTEX_LOCK_PI2 operation was introduced across all architectures in Linux
239 5.14. */
240#if __LINUX_KERNEL_VERSION >= 0x050e00
241# define __ASSUME_FUTEX_LOCK_PI2 1
242#else
243# define __ASSUME_FUTEX_LOCK_PI2 0
244#endif
245
246/* The clone3 system call was introduced across on most architectures in
247 Linux 5.3. Not all ports implements it, so it should be used along
248 HAVE_CLONE3_WRAPPER define. */
249#if __LINUX_KERNEL_VERSION >= 0x050300
250# define __ASSUME_CLONE3 1
251#else
252# define __ASSUME_CLONE3 0
253#endif
254
223255#endif /* kernel-features.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h+1-1
......@@ -1,5 +1,5 @@
11/* Internal definitions for stat functions.
2 Copyright (C) 2021 Free Software Foundation, Inc.
2 Copyright (C) 2021-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c+1-1
......@@ -1,5 +1,5 @@
11/* Get file status. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c+1-1
......@@ -1,5 +1,5 @@
11/* Get file status.
2 Copyright (C) 1996-2021 Free Software Foundation, Inc.
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2010-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2010-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h+9-12
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 2008-2021 Free Software Foundation, Inc.
3 Copyright (C) 2008-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -17,21 +17,11 @@
1717 License along with the GNU C Library. If not, see
1818 <https://www.gnu.org/licenses/>. */
1919
20/* Direct socketcalls available with kernel 4.3. */
21#if __LINUX_KERNEL_VERSION >= 0x040300
22# define __ASSUME_SOCKET_SYSCALL 1
23# define __ASSUME_SOCKETPAIR_SYSCALL 1
24# define __ASSUME_BIND_SYSCALL 1
25# define __ASSUME_LISTEN_SYSCALL 1
26# define __ASSUME_GETSOCKNAME_SYSCALL 1
27# define __ASSUME_GETPEERNAME_SYSCALL 1
28# define __ASSUME_SHUTDOWN_SYSCALL 1
29#endif
30
3120#include_next <kernel-features.h>
3221
3322#undef __ASSUME_ACCEPT_SYSCALL
3423
24/* Direct socketcalls available with kernel 4.3. */
3525#if __LINUX_KERNEL_VERSION < 0x040300
3626# undef __ASSUME_ACCEPT4_SYSCALL
3727# undef __ASSUME_RECVMMSG_SYSCALL
......@@ -43,6 +33,13 @@
4333# undef __ASSUME_SENDTO_SYSCALL
4434# undef __ASSUME_GETSOCKOPT_SYSCALL
4535# undef __ASSUME_SETSOCKOPT_SYSCALL
36# undef __ASSUME_BIND_SYSCALL
37# undef __ASSUME_SOCKET_SYSCALL
38# undef __ASSUME_SOCKETPAIR_SYSCALL
39# undef __ASSUME_LISTEN_SYSCALL
40# undef __ASSUME_SHUTDOWN_SYSCALL
41# undef __ASSUME_GETSOCKNAME_SYSCALL
42# undef __ASSUME_GETPEERNAME_SYSCALL
4643#endif
4744
4845/* No support for PI futexes or robust mutexes before 3.10 for m68k. */
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2010-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2010-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h+3-11
......@@ -1,7 +1,5 @@
1/* Copyright (C) 1996-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1996-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>,
4 December 1995.
53
64 The GNU C Library is free software; you can redistribute it and/or
75 modify it under the terms of the GNU Lesser General Public
......@@ -40,7 +38,7 @@
4038 a large offset. Therefore we must not anymore test for < 0, but test
4139 for a real error by making sure the value in %d0 is a real error
4240 number. Linus said he will make sure the no syscall returns a value
43 in -1 .. -4095 as a valid result so we can savely test with -4095. */
41 in -1 .. -4095 as a valid result so we can safely test with -4095. */
4442
4543/* We don't want the label for the error handler to be visible in the symbol
4644 table when we define it here. */
......@@ -297,12 +295,6 @@ SYSCALL_ERROR_LABEL: \
297295
298296#endif /* not __ASSEMBLER__ */
299297
300/* Pointer mangling is not yet supported for M68K. */
301#define PTR_MANGLE(var) (void) (var)
302#define PTR_DEMANGLE(var) (void) (var)
303
304#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
305298/* M68K needs system-supplied DSO to access TLS helpers
306299 even when statically linked. */
307# define NEED_STATIC_SYSINFO_DSO 1
308#endif
300#define NEED_STATIC_SYSINFO_DSO 1
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel-features.h+1-8
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2011-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2011-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -18,16 +18,9 @@
1818#include <endian.h>
1919
2020/* All supported kernel versions for MicroBlaze have these syscalls. */
21#define __ASSUME_SOCKET_SYSCALL 1
22#define __ASSUME_BIND_SYSCALL 1
2321#define __ASSUME_CONNECT_SYSCALL 1
24#define __ASSUME_LISTEN_SYSCALL 1
25#define __ASSUME_GETSOCKNAME_SYSCALL 1
26#define __ASSUME_GETPEERNAME_SYSCALL 1
27#define __ASSUME_SOCKETPAIR_SYSCALL 1
2822#define __ASSUME_SEND_SYSCALL 1
2923#define __ASSUME_RECV_SYSCALL 1
30#define __ASSUME_SHUTDOWN_SYSCALL 1
3124
3225#include_next <kernel-features.h>
3326
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h+1-1
......@@ -1,5 +1,5 @@
11/* Definition of `struct stat' used in the kernel
2 Copyright (C) 2013-2021 Free Software Foundation, Inc.
2 Copyright (C) 2013-2023 Free Software Foundation, Inc.
33
44 This file is part of the GNU C Library.
55
lib/libc/glibc/sysdeps/unix/sysv/linux/microblaze/sysdep.h+3-9
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
22
33 This file is part of the GNU C Library.
44
......@@ -43,7 +43,7 @@
4343#ifdef __ASSEMBLER__
4444
4545/* In microblaze ABI function call arguments are passed in registers
46 r5...r10. The return value is stored in r3 (or r3:r4 regiters pair).
46 r5...r10. The return value is stored in r3 (or r3:r4 register pair).
4747 Linux syscall uses the same convention with the addition that the
4848 syscall number is passed in r12. To enter the kernel "brki r14,8"
4949 instruction is used.
......@@ -58,7 +58,7 @@
5858 a large offset. Therefore we must not anymore test for < 0, but test
5959 for a real error by making sure the value in %d0 is a real error
6060 number. Linus said he will make sure the no syscall returns a value
61 in -1 .. -4095 as a valid result so we can savely test with -4095. */
61 in -1 .. -4095 as a valid result so we can safely test with -4095. */
6262
6363/* We don't want the label for the error handler to be visible in the symbol
6464 table when we define it here. */
......@@ -304,12 +304,6 @@ SYSCALL_ERROR_LABEL_DCL: \
304304 })
305305
306306
307/* Pointer mangling is not yet supported for Microblaze. */
308# define PTR_MANGLE(var) (void) (var)
309# define PTR_DEMANGLE(var) (void) (var)
310
311# define SINGLE_THREAD_BY_GLOBAL 1
312
313307#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
314308#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
315309
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h+1-5
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -337,8 +337,4 @@ libc_hidden_proto (__mips_syscall7, nomips16)
337337
338338#endif /* __ASSEMBLER__ */
339339
340/* Pointer mangling is not yet supported for MIPS. */
341#define PTR_MANGLE(var) (void) (var)
342#define PTR_DEMANGLE(var) (void) (var)
343
344340#endif /* linux/mips/mips32/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h+1-1
......@@ -1,5 +1,5 @@
11/* Struct stat/stat64 to stat/stat64 conversion for Linux.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h+1-5
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -300,8 +300,4 @@ typedef long int __syscall_arg_t;
300300
301301#endif /* __ASSEMBLER__ */
302302
303/* Pointer mangling is not yet supported for MIPS. */
304#define PTR_MANGLE(var) (void) (var)
305#define PTR_DEMANGLE(var) (void) (var)
306
307303#endif /* linux/mips/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h+1-1
......@@ -1,5 +1,5 @@
11/* Syscall definitions, Linux MIPS generic version.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
2 Copyright (C) 2019-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c+1-2
......@@ -1,5 +1,5 @@
11/* Create a special or ordinary file. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -16,7 +16,6 @@
1616 License along with the GNU C Library; if not, see
1717 <https://www.gnu.org/licenses/>. */
1818
19#include <inttypes.h>
2019#include <sys/types.h>
2120#include <sys/stat.h>
2221#include <errno.h>
lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/kernel_stat.h+1-2
......@@ -1,7 +1,6 @@
11/* Internal definitions for stat functions. Linux/nios2.
2 Copyright (C) 2021 Free Software Foundation, Inc.
2 Copyright (C) 2021-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
54
65 The GNU C Library is free software; you can redistribute it and/or
76 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/unix/sysv/linux/nios2/sysdep.h+2-19
......@@ -1,5 +1,5 @@
11/* Assembler macros for Nios II.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Copyright (C) 2000-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -19,9 +19,9 @@
1919#ifndef _LINUX_NIOS2_SYSDEP_H
2020#define _LINUX_NIOS2_SYSDEP_H 1
2121
22#include <sysdeps/unix/sysv/linux/sysdep.h>
2223#include <sysdeps/unix/sysdep.h>
2324#include <sysdeps/nios2/sysdep.h>
24#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
2525
2626/* For RTLD_PRIVATE_ERRNO. */
2727#include <dl-sysdep.h>
......@@ -220,21 +220,4 @@
220220
221221#endif /* __ASSEMBLER__ */
222222
223/* Pointer mangling support. */
224#if IS_IN (rtld)
225/* We cannot use the thread descriptor because in ld.so we use setjmp
226 earlier than the descriptor is initialized. */
227#else
228# ifdef __ASSEMBLER__
229# define PTR_MANGLE_GUARD(guard) ldw guard, POINTER_GUARD(r23)
230# define PTR_MANGLE(dst, src, guard) xor dst, src, guard
231# define PTR_DEMANGLE(dst, src, guard) PTR_MANGLE (dst, src, guard)
232# else
233# define PTR_MANGLE(var) \
234 (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
235# define PTR_DEMANGLE(var) PTR_MANGLE (var)
236# endif
237#endif
238
239
240223#endif /* linux/nios2/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h+1-8
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. PowerPC version.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -18,16 +18,9 @@
1818 <https://www.gnu.org/licenses/>. */
1919
2020/* New syscalls added for PowerPC in 2.6.37. */
21#define __ASSUME_SOCKET_SYSCALL 1
22#define __ASSUME_BIND_SYSCALL 1
2321#define __ASSUME_CONNECT_SYSCALL 1
24#define __ASSUME_LISTEN_SYSCALL 1
25#define __ASSUME_GETSOCKNAME_SYSCALL 1
26#define __ASSUME_GETPEERNAME_SYSCALL 1
27#define __ASSUME_SOCKETPAIR_SYSCALL 1
2822#define __ASSUME_SEND_SYSCALL 1
2923#define __ASSUME_RECV_SYSCALL 1
30#define __ASSUME_SHUTDOWN_SYSCALL 1
3124
3225/* Define this if your 32-bit syscall API requires 64-bit register
3326 pairs to start with an even-number register. */
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h+1-1
......@@ -1,5 +1,5 @@
11/* Definition of `struct stat' used in the kernel.
2 Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 Copyright (C) 1997-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h+2-40
......@@ -1,5 +1,5 @@
11/* Syscall definitions, Linux PowerPC generic version.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
2 Copyright (C) 2019-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -207,38 +207,6 @@
207207#define ASM_INPUT_5 ASM_INPUT_4, "5" (r7)
208208#define ASM_INPUT_6 ASM_INPUT_5, "6" (r8)
209209
210
211/* Pointer mangling support. */
212#if IS_IN (rtld)
213/* We cannot use the thread descriptor because in ld.so we use setjmp
214 earlier than the descriptor is initialized. */
215#else
216# ifdef __ASSEMBLER__
217# if defined(__PPC64__) || defined(__powerpc64__)
218# define LOAD ld
219# define TPREG r13
220# else
221# define LOAD lwz
222# define TPREG r2
223# endif
224# define PTR_MANGLE(reg, tmpreg) \
225 LOAD tmpreg,POINTER_GUARD(TPREG); \
226 xor reg,tmpreg,reg
227# define PTR_MANGLE2(reg, tmpreg) \
228 xor reg,tmpreg,reg
229# define PTR_MANGLE3(destreg, reg, tmpreg) \
230 LOAD tmpreg,POINTER_GUARD(TPREG); \
231 xor destreg,tmpreg,reg
232# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
233# define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg)
234# define PTR_DEMANGLE3(destreg, reg, tmpreg) PTR_MANGLE3 (destreg, reg, tmpreg)
235# else
236# define PTR_MANGLE(var) \
237 (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
238# define PTR_DEMANGLE(var) PTR_MANGLE (var)
239# endif
240#endif
241
242210/* List of system calls which are supported as vsyscalls. */
243211#define VDSO_NAME "LINUX_2.6.15"
244212#define VDSO_HASH 123718565
......@@ -246,6 +214,7 @@
246214#if defined(__PPC64__) || defined(__powerpc64__)
247215#define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
248216#define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
217#define HAVE_CLONE3_WRAPPER 1
249218#else
250219#define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres"
251220#define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime"
......@@ -255,11 +224,4 @@
255224#define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
256225#define HAVE_GET_TBFREQ "__kernel_get_tbfreq"
257226
258#if defined(__PPC64__) || defined(__powerpc64__)
259# define HAVE_SIGTRAMP_RT64 "__kernel_sigtramp_rt64"
260#else
261# define HAVE_SIGTRAMP_32 "__kernel_sigtramp32"
262# define HAVE_SIGTRAMP_RT32 "__kernel_sigtramp_rt32"
263#endif
264
265227#endif /* _LINUX_POWERPC_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. RISC-V version.
3 Copyright (C) 2018-2021 Free Software Foundation, Inc.
3 Copyright (C) 2018-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h+5-7
......@@ -19,7 +19,8 @@
1919#ifndef _LINUX_RISCV_SYSDEP_H
2020#define _LINUX_RISCV_SYSDEP_H 1
2121
22#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
22#include <sysdeps/unix/sysv/linux/sysdep.h>
23#include <sysdeps/unix/sysdep.h>
2324#include <tls.h>
2425
2526#undef SYS_ify
......@@ -102,7 +103,7 @@
102103# else
103104# define SYSCALL_ERROR_HANDLER(name) \
104105.Lsyscall_error ## name: \
105 j __syscall_error;
106 tail __syscall_error;
106107# endif
107108
108109/* Performs a system call, not setting errno. */
......@@ -120,7 +121,7 @@
120121# undef ret_NOERRNO
121122# define ret_NOERRNO ret
122123
123/* Perfroms a system call, returning the error code. */
124/* Performs a system call, returning the error code. */
124125# undef PSEUDO_ERRVAL
125126# define PSEUDO_ERRVAL(name, syscall_name, args) \
126127 PSEUDO_NOERRNO (name, syscall_name, args) \
......@@ -150,6 +151,7 @@
150151
151152/* RV32 does not support the gettime VDSO syscalls. */
152153# endif
154# define HAVE_CLONE3_WRAPPER 1
153155
154156/* List of system calls which are supported as vsyscalls (for RV32 and
155157 RV64). */
......@@ -357,8 +359,4 @@ extern long int __syscall_error (long int neg_errno);
357359
358360#endif /* ! __ASSEMBLER__ */
359361
360/* Pointer mangling is not supported. */
361#define PTR_MANGLE(var) (void) (var)
362#define PTR_DEMANGLE(var) (void) (var)
363
364362#endif /* linux/riscv/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h+1-1
......@@ -1,5 +1,5 @@
11/* bits/typesizes.h -- underlying types for *_t. Linux/s390 version.
2 Copyright (C) 2003-2021 Free Software Foundation, Inc.
2 Copyright (C) 2003-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h+9-12
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. S/390 version.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -17,21 +17,11 @@
1717 License along with the GNU C Library; if not, see
1818 <https://www.gnu.org/licenses/>. */
1919
20/* Direct socketcalls available with kernel 4.3. */
21#if __LINUX_KERNEL_VERSION >= 0x040300
22# define __ASSUME_SOCKET_SYSCALL 1
23# define __ASSUME_SOCKETPAIR_SYSCALL 1
24# define __ASSUME_BIND_SYSCALL 1
25# define __ASSUME_LISTEN_SYSCALL 1
26# define __ASSUME_GETSOCKNAME_SYSCALL 1
27# define __ASSUME_GETPEERNAME_SYSCALL 1
28# define __ASSUME_SHUTDOWN_SYSCALL 1
29#endif
30
3120#include_next <kernel-features.h>
3221
3322#undef __ASSUME_ACCEPT_SYSCALL
3423
24/* Direct socketcalls available with kernel 4.3. */
3525#if __LINUX_KERNEL_VERSION < 0x040300
3626# undef __ASSUME_ACCEPT4_SYSCALL
3727# undef __ASSUME_RECVMMSG_SYSCALL
......@@ -43,6 +33,13 @@
4333# undef __ASSUME_SENDTO_SYSCALL
4434# undef __ASSUME_GETSOCKOPT_SYSCALL
4535# undef __ASSUME_SETSOCKOPT_SYSCALL
36# undef __ASSUME_BIND_SYSCALL
37# undef __ASSUME_SOCKET_SYSCALL
38# undef __ASSUME_SOCKETPAIR_SYSCALL
39# undef __ASSUME_LISTEN_SYSCALL
40# undef __ASSUME_SHUTDOWN_SYSCALL
41# undef __ASSUME_GETSOCKNAME_SYSCALL
42# undef __ASSUME_GETPEERNAME_SYSCALL
4643#endif
4744
4845/* s390 only supports ipc syscall before 5.1. */
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h+2-28
......@@ -1,5 +1,4 @@
1/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
2 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
1/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
32 This file is part of the GNU C Library.
43
54 The GNU C Library is free software; you can redistribute it and/or
......@@ -43,7 +42,7 @@
4342 a large offset. Therefore we must not anymore test for < 0, but test
4443 for a real error by making sure the value in gpr2 is a real error
4544 number. Linus said he will make sure that no syscall returns a value
46 in -1 .. -4095 as a valid result so we can savely test with -4095. */
45 in -1 .. -4095 as a valid result so we can safely test with -4095. */
4746
4847#undef PSEUDO
4948#define PSEUDO(name, syscall_name, args) \
......@@ -156,12 +155,8 @@
156155 lr %r0,%r7; \
157156 l %r7,96(%r15); \
158157 .endif; \
159 .if SYS_ify (syscall) < 256; \
160 svc SYS_ify (syscall); \
161 .else; \
162158 lhi %r1,SYS_ify (syscall); \
163159 svc 0; \
164 .endif; \
165160 .if args > 5; \
166161 lr %r7,%r0; \
167162 .endif
......@@ -182,25 +177,4 @@
182177
183178#endif /* __ASSEMBLER__ */
184179
185/* Pointer mangling support. */
186#if IS_IN (rtld)
187/* We cannot use the thread descriptor because in ld.so we use setjmp
188 earlier than the descriptor is initialized. */
189#else
190/* For the time being just use stack_guard rather than a separate
191 pointer_guard. */
192# ifdef __ASSEMBLER__
193# define PTR_MANGLE(reg, tmpreg) \
194 ear tmpreg,%a0; \
195 x reg,STACK_GUARD(tmpreg)
196# define PTR_MANGLE2(reg, tmpreg) \
197 x reg,STACK_GUARD(tmpreg)
198# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
199# else
200# define PTR_MANGLE(var) \
201 (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
202# define PTR_DEMANGLE(var) PTR_MANGLE (var)
203# endif
204#endif
205
206180#endif /* _LINUX_S390_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h+2-30
......@@ -1,6 +1,5 @@
11/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
43 This file is part of the GNU C Library.
54
65 The GNU C Library is free software; you can redistribute it and/or
......@@ -47,7 +46,7 @@
4746 a large offset. Therefore we must not anymore test for < 0, but test
4847 for a real error by making sure the value in gpr2 is a real error
4948 number. Linus said he will make sure that no syscall returns a value
50 in -1 .. -4095 as a valid result so we can savely test with -4095. */
49 in -1 .. -4095 as a valid result so we can safely test with -4095. */
5150
5251#undef PSEUDO
5352#define PSEUDO(name, syscall_name, args) \
......@@ -154,12 +153,8 @@
154153 lgr %r0,%r7; \
155154 lg %r7,160(%r15); \
156155 .endif; \
157 .if SYS_ify (syscall) < 256; \
158 svc SYS_ify (syscall); \
159 .else; \
160156 lghi %r1,SYS_ify (syscall); \
161157 svc 0; \
162 .endif; \
163158 .if args > 5; \
164159 lgr %r7,%r0; \
165160 .endif
......@@ -180,27 +175,4 @@
180175
181176#endif /* __ASSEMBLER__ */
182177
183/* Pointer mangling support. */
184#if IS_IN (rtld)
185/* We cannot use the thread descriptor because in ld.so we use setjmp
186 earlier than the descriptor is initialized. */
187#else
188/* For the time being just use stack_guard rather than a separate
189 pointer_guard. */
190# ifdef __ASSEMBLER__
191# define PTR_MANGLE(reg, tmpreg) \
192 ear tmpreg,%a0; \
193 sllg tmpreg,tmpreg,32; \
194 ear tmpreg,%a1; \
195 xg reg,STACK_GUARD(tmpreg)
196# define PTR_MANGLE2(reg, tmpreg) \
197 xg reg,STACK_GUARD(tmpreg)
198# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
199# else
200# define PTR_MANGLE(var) \
201 (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
202# define PTR_DEMANGLE(var) PTR_MANGLE (var)
203# endif
204#endif
205
206178#endif /* _LINUX_S390_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h+4-34
......@@ -1,5 +1,5 @@
11/* Syscall definitions, Linux s390 version.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
2 Copyright (C) 2019-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -21,32 +21,6 @@
2121#undef SYS_ify
2222#define SYS_ify(syscall_name) __NR_##syscall_name
2323
24#undef INTERNAL_SYSCALL_DIRECT
25#define INTERNAL_SYSCALL_DIRECT(name, nr, args...) \
26 ({ \
27 DECLARGS_##nr(args) \
28 register long int _ret __asm__("2"); \
29 __asm__ __volatile__ ( \
30 "svc %b1\n\t" \
31 : "=d" (_ret) \
32 : "i" (__NR_##name) ASMFMT_##nr \
33 : "memory" ); \
34 _ret; })
35
36#undef INTERNAL_SYSCALL_SVC0
37#define INTERNAL_SYSCALL_SVC0(name, nr, args...) \
38 ({ \
39 DECLARGS_##nr(args) \
40 register unsigned long int _nr __asm__("1") = \
41 (unsigned long int)(__NR_##name); \
42 register long int _ret __asm__("2"); \
43 __asm__ __volatile__ ( \
44 "svc 0\n\t" \
45 : "=d" (_ret) \
46 : "d" (_nr) ASMFMT_##nr \
47 : "memory" ); \
48 _ret; })
49
5024#undef INTERNAL_SYSCALL_NCS
5125#define INTERNAL_SYSCALL_NCS(no, nr, args...) \
5226 ({ \
......@@ -61,10 +35,8 @@
6135 _ret; })
6236
6337#undef INTERNAL_SYSCALL
64#define INTERNAL_SYSCALL(name, nr, args...) \
65 (((__NR_##name) < 256) \
66 ? INTERNAL_SYSCALL_DIRECT(name, nr, args) \
67 : INTERNAL_SYSCALL_SVC0(name, nr, args))
38#define INTERNAL_SYSCALL(name, nr, args...) \
39 INTERNAL_SYSCALL_NCS(__NR_##name, nr, args)
6840
6941#define DECLARGS_0()
7042#define DECLARGS_1(arg1) \
......@@ -93,9 +65,6 @@
9365#define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
9466#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
9567
96#define SINGLE_THREAD_BY_GLOBAL 1
97
98
9968#define VDSO_NAME "LINUX_2.6.29"
10069#define VDSO_HASH 123718585
10170
......@@ -110,4 +79,5 @@
11079#define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
11180#define HAVE_GETCPU_VSYSCALL "__kernel_getcpu"
11281
82#define HAVE_CLONE3_WRAPPER 1
11383#endif
lib/libc/glibc/sysdeps/unix/sysv/linux/sh/kernel-features.h+1-8
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. SH version.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -23,16 +23,9 @@
2323#include <endian.h>
2424
2525/* These syscalls were added for SH in 2.6.37. */
26#define __ASSUME_SOCKET_SYSCALL 1
27#define __ASSUME_BIND_SYSCALL 1
2826#define __ASSUME_CONNECT_SYSCALL 1
29#define __ASSUME_LISTEN_SYSCALL 1
30#define __ASSUME_GETSOCKNAME_SYSCALL 1
31#define __ASSUME_GETPEERNAME_SYSCALL 1
32#define __ASSUME_SOCKETPAIR_SYSCALL 1
3327#define __ASSUME_SEND_SYSCALL 1
3428#define __ASSUME_RECV_SYSCALL 1
35#define __ASSUME_SHUTDOWN_SYSCALL 1
3629
3730#include_next <kernel-features.h>
3831
lib/libc/glibc/sysdeps/unix/sysv/linux/sh/sysdep.h+2-23
......@@ -1,7 +1,5 @@
1/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
4 Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
53
64 The GNU C Library is free software; you can redistribute it and/or
75 modify it under the terms of the GNU Lesser General Public
......@@ -43,7 +41,7 @@
4341 might return a large offset. Therefore we must not anymore test
4442 for < 0, but test for a real error by making sure the value in R0
4543 is a real error number. Linus said he will make sure the no syscall
46 returns a value in -1 .. -4095 as a valid result so we can savely
44 returns a value in -1 .. -4095 as a valid result so we can safely
4745 test with -4095. */
4846
4947#define _IMM1 #-1
......@@ -317,23 +315,4 @@
317315
318316#endif /* __ASSEMBLER__ */
319317
320/* Pointer mangling support. */
321#if IS_IN (rtld)
322/* We cannot use the thread descriptor because in ld.so we use setjmp
323 earlier than the descriptor is initialized. Using a global variable
324 is too complicated here since we have no PC-relative addressing mode. */
325#else
326# ifdef __ASSEMBLER__
327# define PTR_MANGLE(reg, tmp) \
328 stc gbr,tmp; mov.l @(POINTER_GUARD,tmp),tmp; xor tmp,reg
329# define PTR_MANGLE2(reg, tmp) xor tmp,reg
330# define PTR_DEMANGLE(reg, tmp) PTR_MANGLE (reg, tmp)
331# define PTR_DEMANGLE2(reg, tmp) PTR_MANGLE2 (reg, tmp)
332# else
333# define PTR_MANGLE(var) \
334 (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
335# define PTR_DEMANGLE(var) PTR_MANGLE (var)
336# endif
337#endif
338
339318#endif /* linux/sh/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h+6-7
......@@ -1,5 +1,5 @@
11/* Single thread optimization, Linux version.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
2 Copyright (C) 2019-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -19,6 +19,10 @@
1919#ifndef _SINGLE_THREAD_H
2020#define _SINGLE_THREAD_H
2121
22#ifndef __ASSEMBLER__
23# include <sys/single_threaded.h>
24#endif
25
2226/* The default way to check if the process is single thread is by using the
2327 pthread_t 'multiple_threads' field. However, for some architectures it is
2428 faster to either use an extra field on TCB or global variables (the TCB
......@@ -27,16 +31,11 @@
2731 The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single thread
2832 check to use global variables instead of the pthread_t field. */
2933
30#ifndef __ASSEMBLER__
31extern int __libc_multiple_threads;
32libc_hidden_proto (__libc_multiple_threads)
33#endif
34
3534#if !defined SINGLE_THREAD_BY_GLOBAL || IS_IN (rtld)
3635# define SINGLE_THREAD_P \
3736 (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0)
3837#else
39# define SINGLE_THREAD_P (__libc_multiple_threads == 0)
38# define SINGLE_THREAD_P (__libc_single_threaded_internal != 0)
4039#endif
4140
4241#define RTLD_SINGLE_THREAD_P SINGLE_THREAD_P
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h+1-1
......@@ -1,5 +1,5 @@
11/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version.
2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h+11-8
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. SPARC version.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
......@@ -40,16 +40,19 @@
4040# undef __ASSUME_SENDTO_SYSCALL
4141# undef __ASSUME_GETSOCKOPT_SYSCALL
4242# undef __ASSUME_SETSOCKOPT_SYSCALL
43#else
44# define __ASSUME_SOCKET_SYSCALL 1
45# define __ASSUME_SOCKETPAIR_SYSCALL 1
46# define __ASSUME_SHUTDOWN_SYSCALL 1
43#endif
44
45/* There syscalls were added for 32-bit in compat syscall table only
46 in 4.20 (but present for 64-bit in all supported kernel versions). */
47#if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x041400
48# undef __ASSUME_GETSOCKNAME_SYSCALL
49# undef __ASSUME_GETPEERNAME_SYSCALL
4750#endif
4851
4952/* These syscalls were added for both 32-bit and 64-bit in 4.4. */
50#if __LINUX_KERNEL_VERSION >= 0x040400
51# define __ASSUME_BIND_SYSCALL 1
52# define __ASSUME_LISTEN_SYSCALL 1
53#if __LINUX_KERNEL_VERSION < 0x040400
54# undef __ASSUME_BIND_SYSCALL
55# undef __ASSUME_LISTEN_SYSCALL
5356#endif
5457
5558#ifdef __arch64__
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h+1-22
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
......@@ -126,24 +125,4 @@ ENTRY(name); \
126125
127126#endif /* __ASSEMBLER__ */
128127
129/* Pointer mangling support. */
130#if IS_IN (rtld)
131/* We cannot use the thread descriptor because in ld.so we use setjmp
132 earlier than the descriptor is initialized. */
133#else
134# ifdef __ASSEMBLER__
135# define PTR_MANGLE(dreg, reg, tmpreg) \
136 ld [%g7 + POINTER_GUARD], tmpreg; \
137 xor reg, tmpreg, dreg
138# define PTR_DEMANGLE(dreg, reg, tmpreg) PTR_MANGLE (dreg, reg, tmpreg)
139# define PTR_MANGLE2(dreg, reg, tmpreg) \
140 xor reg, tmpreg, dreg
141# define PTR_DEMANGLE2(dreg, reg, tmpreg) PTR_MANGLE2 (dreg, reg, tmpreg)
142# else
143# define PTR_MANGLE(var) \
144 (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
145# define PTR_DEMANGLE(var) PTR_MANGLE (var)
146# endif
147#endif
148
149128#endif /* linux/sparc/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h+1-1
......@@ -1,5 +1,5 @@
11/* Struct kernel_stat64 to stat64. Linux/SPARC version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h+1-22
......@@ -1,6 +1,5 @@
1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
......@@ -128,24 +127,4 @@ ENTRY(name); \
128127 register windows. So if you poke stack memory directly you add this. */
129128#define STACK_BIAS 2047
130129
131/* Pointer mangling support. */
132#if IS_IN (rtld)
133/* We cannot use the thread descriptor because in ld.so we use setjmp
134 earlier than the descriptor is initialized. */
135#else
136# ifdef __ASSEMBLER__
137# define PTR_MANGLE(dreg, reg, tmpreg) \
138 ldx [%g7 + POINTER_GUARD], tmpreg; \
139 xor reg, tmpreg, dreg
140# define PTR_DEMANGLE(dreg, reg, tmpreg) PTR_MANGLE (dreg, reg, tmpreg)
141# define PTR_MANGLE2(dreg, reg, tmpreg) \
142 xor reg, tmpreg, dreg
143# define PTR_DEMANGLE2(dreg, reg, tmpreg) PTR_MANGLE2 (dreg, reg, tmpreg)
144# else
145# define PTR_MANGLE(var) \
146 (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
147# define PTR_DEMANGLE(var) PTR_MANGLE (var)
148# endif
149#endif
150
151130#endif /* linux/sparc64/sysdep.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h+1-2
......@@ -1,6 +1,5 @@
1/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2000-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
3 Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
43
54 The GNU C Library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c+1-1
......@@ -1,5 +1,5 @@
11/* Get file status. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c+1-1
......@@ -1,5 +1,5 @@
11/* Get file status. Linux version.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c+1-20
......@@ -1,5 +1,5 @@
11/* Struct stat/stat64 to stat/stat64 conversion for Linux.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -22,25 +22,6 @@
2222#include <time.h>
2323
2424#if __TIMESIZE != 64
25
26static inline bool
27in_time_t_range (__time64_t t)
28{
29 time_t s = t;
30 return s == t;
31}
32
33static inline struct timespec
34valid_timespec64_to_timespec (const struct __timespec64 ts64)
35{
36 struct timespec ts;
37
38 ts.tv_sec = (time_t) ts64.tv_sec;
39 ts.tv_nsec = ts64.tv_nsec;
40
41 return ts;
42}
43
4425int
4526__cp_stat64_t64_stat64 (const struct __stat64_t64 *st64_t64,
4627 struct stat64 *st64)
lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h+1-1
......@@ -1,5 +1,5 @@
11/* Copy to/from struct stat with and without 64-bit time_t support.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h+1-1
......@@ -1,5 +1,5 @@
11/* Struct stat with 64-bit time support.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
2 Copyright (C) 2020-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h+9-9
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -55,26 +55,26 @@ struct ntptimeval
5555__BEGIN_DECLS
5656
5757#ifndef __USE_TIME_BITS64
58extern int adjtimex (struct timex *__ntx) __THROW;
59extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
58extern int adjtimex (struct timex *__ntx) __THROW __nonnull ((1));
59extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW __nonnull ((1));
6060
6161# ifdef __REDIRECT_NTH
6262extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
63 ntp_gettimex);
63 ntp_gettimex) __nonnull ((1));
6464# else
6565# define ntp_gettime ntp_gettimex
6666# endif
67extern int ntp_adjtime (struct timex *__tntx) __THROW;
67extern int ntp_adjtime (struct timex *__tntx) __THROW __nonnull ((1));
6868#else
6969# ifdef __REDIRECT_NTH
7070extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
71 ___adjtimex64);
71 ___adjtimex64) __nonnull ((1));
7272extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
73 __ntp_gettime64);
73 __ntp_gettime64) __nonnull ((1));
7474extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
75 __ntp_gettimex64);
75 __ntp_gettimex64) __nonnull ((1));
7676extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx),
77 ___adjtimex64);
77 ___adjtimex64) __nonnull ((1));
7878# else
7979# define adjtimex ___adjtimex64
8080# define ntp_adjtime ___adjtimex64
lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2015-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2015-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h+1-1
......@@ -1,5 +1,5 @@
11/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1998-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1998-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h+1-1
......@@ -1,6 +1,6 @@
11/* Set flags signalling availability of kernel features based on given
22 kernel version number. x86-64 version.
3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
44 This file is part of the GNU C Library.
55
66 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h+2-44
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2001-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2001-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
......@@ -43,7 +43,7 @@
4343 might return a large offset. Therefore we must not anymore test
4444 for < 0, but test for a real error by making sure the value in %eax
4545 is a real error number. Linus said he will make sure the no syscall
46 returns a value in -1 .. -4095 as a valid result so we can savely
46 returns a value in -1 .. -4095 as a valid result so we can safely
4747 test with -4095. */
4848
4949/* We don't want the label for the error handle to be global when we define
......@@ -379,50 +379,8 @@
379379
380380# define HAVE_CLONE3_WRAPPER 1
381381
382# define SINGLE_THREAD_BY_GLOBAL 1
383
384382#endif /* __ASSEMBLER__ */
385383
386
387/* Pointer mangling support. */
388#if IS_IN (rtld)
389/* We cannot use the thread descriptor because in ld.so we use setjmp
390 earlier than the descriptor is initialized. */
391# ifdef __ASSEMBLER__
392# define PTR_MANGLE(reg) xor __pointer_chk_guard_local(%rip), reg; \
393 rol $2*LP_SIZE+1, reg
394# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \
395 xor __pointer_chk_guard_local(%rip), reg
396# else
397# define PTR_MANGLE(reg) asm ("xor __pointer_chk_guard_local(%%rip), %0\n" \
398 "rol $2*" LP_SIZE "+1, %0" \
399 : "=r" (reg) : "0" (reg))
400# define PTR_DEMANGLE(reg) asm ("ror $2*" LP_SIZE "+1, %0\n" \
401 "xor __pointer_chk_guard_local(%%rip), %0" \
402 : "=r" (reg) : "0" (reg))
403# endif
404#else
405# ifdef __ASSEMBLER__
406# define PTR_MANGLE(reg) xor %fs:POINTER_GUARD, reg; \
407 rol $2*LP_SIZE+1, reg
408# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \
409 xor %fs:POINTER_GUARD, reg
410# else
411# define PTR_MANGLE(var) asm ("xor %%fs:%c2, %0\n" \
412 "rol $2*" LP_SIZE "+1, %0" \
413 : "=r" (var) \
414 : "0" (var), \
415 "i" (offsetof (tcbhead_t, \
416 pointer_guard)))
417# define PTR_DEMANGLE(var) asm ("ror $2*" LP_SIZE "+1, %0\n" \
418 "xor %%fs:%c2, %0" \
419 : "=r" (var) \
420 : "0" (var), \
421 "i" (offsetof (tcbhead_t, \
422 pointer_guard)))
423# endif
424#endif
425
426384/* How to pass the off{64}_t argument on p{readv,writev}{64}. */
427385#undef LO_HI_LONG
428386#define LO_HI_LONG(val) (val), 0
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2012-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2012-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/xstatver.h+4-7
......@@ -1,13 +1,10 @@
11/* Versions of the 'struct stat' data structure used in compatibility xstat
22 functions. */
3#define _STAT_VER_LINUX_OLD 1
4#define _STAT_VER_KERNEL 1
5#define _STAT_VER_SVR4 2
6#define _STAT_VER_LINUX 3
7#define _STAT_VER _STAT_VER_LINUX
3#define _STAT_VER_KERNEL 0
4#define _STAT_VER_LINUX 0
5#define _STAT_VER _STAT_VER_KERNEL
86
97/* Versions of the 'xmknod' interface used in compatibility xmknod
108 functions. */
11#define _MKNOD_VER_LINUX 1
12#define _MKNOD_VER_SVR4 2
9#define _MKNOD_VER_LINUX 0
1310#define _MKNOD_VER _MKNOD_VER_LINUX
lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
1/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h+3-2
......@@ -1,5 +1,5 @@
11/* Hacks needed for divdi3 symbol manipulation.
2 Copyright (C) 2004-2021 Free Software Foundation, Inc.
2 Copyright (C) 2004-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -23,7 +23,8 @@
2323 assembler.
2424 Note: in_divdi3_c is only used to avoid symbol alias on divdi3
2525 build itself. */
26#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED
26#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) \
27 && defined SHARED && !defined LIBC_NONSHARED
2728asm ("__divdi3 = __divdi3_internal");
2829asm ("__udivdi3 = __udivdi3_internal");
2930asm ("__moddi3 = __moddi3_internal");
lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h+1-1
......@@ -1,4 +1,4 @@
1/* Copyright (C) 2002-2021 Free Software Foundation, Inc.
1/* Copyright (C) 2002-2023 Free Software Foundation, Inc.
22 This file is part of the GNU C Library.
33
44 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/x86/sysdep.h+8-4
......@@ -1,5 +1,5 @@
11/* Assembler macros for x86.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -78,15 +78,18 @@ enum cf_protection_level
7878#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
7979
8080/* Define an entry point visible from C. */
81#define ENTRY(name) \
81#define ENTRY_P2ALIGN(name, alignment) \
8282 .globl C_SYMBOL_NAME(name); \
8383 .type C_SYMBOL_NAME(name),@function; \
84 .align ALIGNARG(4); \
84 .align ALIGNARG(alignment); \
8585 C_LABEL(name) \
8686 cfi_startproc; \
8787 _CET_ENDBR; \
8888 CALL_MCOUNT
8989
90/* Common entry 16 byte aligns. */
91#define ENTRY(name) ENTRY_P2ALIGN (name, 4)
92
9093#undef END
9194#define END(name) \
9295 cfi_endproc; \
......@@ -108,7 +111,8 @@ enum cf_protection_level
108111/* Local label name for asm code. */
109112#ifndef L
110113/* ELF-like local names start with `.L'. */
111# define L(name) .L##name
114# define LOCAL_LABEL(name) .L##name
115# define L(name) LOCAL_LABEL(name)
112116#endif
113117
114118#define atom_text_section .section ".text.atom", "ax"
lib/libc/glibc/sysdeps/x86_64/crti.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for x86-64.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/x86_64/crtn.S+1-1
......@@ -1,5 +1,5 @@
11/* Special .init and .fini section support for x86-64.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/x86_64/start.S+1-2
......@@ -1,7 +1,6 @@
11/* Startup code compliant to the ELF x86-64 ABI.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
4 Contributed by Andreas Jaeger <aj@suse.de>, 2001.
54
65 The GNU C Library is free software; you can redistribute it and/or
76 modify it under the terms of the GNU Lesser General Public
lib/libc/glibc/sysdeps/x86_64/sysdep.h+23-10
......@@ -1,5 +1,5 @@
11/* Assembler macros for x86-64.
2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -20,6 +20,7 @@
2020#define _X86_64_SYSDEP_H 1
2121
2222#include <sysdeps/x86/sysdep.h>
23#include <x86-lp_size.h>
2324
2425#ifdef __ASSEMBLER__
2526
......@@ -68,9 +69,6 @@ lose: \
6869# define JUMPTARGET(name) name
6970#endif
7071
71/* Long and pointer size in bytes. */
72#define LP_SIZE 8
73
7472/* Instruction to operate on long and pointer. */
7573#define LP_OP(insn) insn##q
7674
......@@ -99,13 +97,31 @@ lose: \
9997 to avoid RTM abort triggered by VZEROUPPER inside transactionally. */
10098#define ZERO_UPPER_VEC_REGISTERS_RETURN_XTEST \
10199 xtest; \
102 jz 1f; \
103 vzeroall; \
100 jnz 1f; \
101 vzeroupper; \
104102 ret; \
1051031: \
106 vzeroupper; \
104 vzeroall; \
107105 ret
108106
107/* Can be used to replace vzeroupper that is not directly before a
108 return. This is useful when hoisting a vzeroupper from multiple
109 return paths to decrease the total number of vzerouppers and code
110 size. */
111#define COND_VZEROUPPER_XTEST \
112 xtest; \
113 jz 1f; \
114 vzeroall; \
115 jmp 2f; \
1161: \
117 vzeroupper; \
1182:
119
120/* In RTM define this as COND_VZEROUPPER_XTEST. */
121#ifndef COND_VZEROUPPER
122# define COND_VZEROUPPER vzeroupper
123#endif
124
109125/* Zero upper vector registers and return. */
110126#ifndef ZERO_UPPER_VEC_REGISTERS_RETURN
111127# define ZERO_UPPER_VEC_REGISTERS_RETURN \
......@@ -119,9 +135,6 @@ lose: \
119135
120136#else /* __ASSEMBLER__ */
121137
122/* Long and pointer size in bytes. */
123#define LP_SIZE "8"
124
125138/* Instruction to operate on long and pointer. */
126139#define LP_OP(insn) #insn "q"
127140
lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h+2-6
......@@ -1,5 +1,5 @@
11/* Assembler macros for x32.
2 Copyright (C) 2012-2021 Free Software Foundation, Inc.
2 Copyright (C) 2012-2023 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
44
55 The GNU C Library is free software; you can redistribute it and/or
......@@ -17,8 +17,8 @@
1717 <https://www.gnu.org/licenses/>. */
1818
1919#include <sysdeps/x86_64/sysdep.h>
20#include <x86-lp_size.h>
2021
21#undef LP_SIZE
2222#undef LP_OP
2323#undef ASM_ADDR
2424
......@@ -41,8 +41,6 @@
4141
4242#ifdef __ASSEMBLER__
4343
44# define LP_SIZE 4
45
4644# define LP_OP(insn) insn##l
4745
4846# define ASM_ADDR .long
......@@ -66,8 +64,6 @@
6664
6765#else /* __ASSEMBLER__ */
6866
69# define LP_SIZE "4"
70
7167# define LP_OP(insn) #insn "l"
7268
7369# define ASM_ADDR ".long"