aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--benchtests/Makefile2
-rw-r--r--elf/dl-execstack-tunable.c2
-rw-r--r--elf/dl-execstack.c2
-rw-r--r--elf/dl-load.c4
-rw-r--r--stdio-common/printf_fp.c18
-rw-r--r--sysdeps/generic/ldsodefs.h2
-rw-r--r--sysdeps/ieee754/flt-32/e_atanhf.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_coshf.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_logf.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_sinhf.c6
-rw-r--r--sysdeps/ieee754/flt-32/s_cbrtf.c6
-rw-r--r--sysdeps/ieee754/flt-32/s_cospif.c6
-rw-r--r--sysdeps/ieee754/flt-32/s_erfcf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_sinpif.c8
-rw-r--r--sysdeps/mach/hurd/dl-execstack.c5
-rw-r--r--sysdeps/pthread/Makefile9
-rw-r--r--sysdeps/pthread/tst-stack2-mod.c39
-rw-r--r--sysdeps/pthread/tst-stack2.c47
-rw-r--r--sysdeps/riscv/math-use-builtins-ffs.h10
-rw-r--r--sysdeps/unix/sysv/linux/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/bits/ioctl-types.h11
-rw-r--r--sysdeps/unix/sysv/linux/dl-execstack.c7
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h12
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h11
-rw-r--r--sysdeps/unix/sysv/linux/termio.h6
26 files changed, 150 insertions, 90 deletions
diff --git a/NEWS b/NEWS
index 740225a..df7268e 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,11 @@ Deprecated and removed features, and other changes affecting compatibility:
programs that require an executable stack through dynamic loaded
shared libraries.
+* On Linux, the <termio.h> header and the definition of struct termio
+ in <sys/ioctl.h> have been removed. The termio interface has been
+ obsolete since the very first version of POSIX.1 in 1988, replaced
+ with <termios.h>.
+
Changes to build and runtime requirements:
* GCC 12.1 or later is now required to build the GNU C Library.
diff --git a/benchtests/Makefile b/benchtests/Makefile
index cccee62..74142da 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -493,7 +493,7 @@ bench-set: $(binaries-benchset)
bench-malloc: $(binaries-bench-malloc)
for run in $^; do \
echo "$${run}"; \
- if [[ `basename $${run}` =~ bench-[cm]alloc-thread ]]; then \
+ if basename $${run} | grep -q "bench-[cm]alloc-thread"; then \
for thr in 1 8 16 32; do \
echo "Running $${run} $${thr}"; \
$(run-bench) $${thr} > $${run}-$${thr}.out; \
diff --git a/elf/dl-execstack-tunable.c b/elf/dl-execstack-tunable.c
index 6cef1a3..e3b638a 100644
--- a/elf/dl-execstack-tunable.c
+++ b/elf/dl-execstack-tunable.c
@@ -31,7 +31,7 @@ _dl_handle_execstack_tunable (void)
break;
case stack_tunable_mode_force:
- if (_dl_make_stack_executable (&__libc_stack_end) != 0)
+ if (_dl_make_stack_executable (__libc_stack_end) != 0)
_dl_fatal_printf (
"Fatal glibc error: cannot enable executable stack as tunable requires");
break;
diff --git a/elf/dl-execstack.c b/elf/dl-execstack.c
index e4d7dbe..ceec5b2 100644
--- a/elf/dl-execstack.c
+++ b/elf/dl-execstack.c
@@ -23,7 +23,7 @@
so as to mprotect it. */
int
-_dl_make_stack_executable (void **stack_endp)
+_dl_make_stack_executable (const void *stack_endp)
{
return ENOSYS;
}
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 6b7e979..bf29ec7 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -945,7 +945,7 @@ struct link_map *
_dl_map_object_from_fd (const char *name, const char *origname, int fd,
struct filebuf *fbp, char *realname,
struct link_map *loader, int l_type, int mode,
- void **stack_endp, Lmid_t nsid)
+ const void *stack_endp, Lmid_t nsid)
{
struct link_map *l = NULL;
const ElfW(Ehdr) *header;
@@ -2181,7 +2181,7 @@ _dl_map_new_object (struct link_map *loader, const char *name,
void *stack_end = __libc_stack_end;
return _dl_map_object_from_fd (name, origname, fd, &fb, realname, loader,
- type, mode, &stack_end, nsid);
+ type, mode, stack_end, nsid);
}
struct link_map *
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index 5b46ddc..0039e1b 100644
--- a/stdio-common/printf_fp.c
+++ b/stdio-common/printf_fp.c
@@ -29,7 +29,6 @@
#include <gmp.h>
#include <ieee754.h>
#include <stdlib/gmp-impl.h>
-#include <stdlib/longlong.h>
#include <stdlib/fpioconst.h>
#include <locale/localeinfo.h>
#include <limits.h>
@@ -40,6 +39,7 @@
#include <stdlib.h>
#include <wchar.h>
#include <stdbool.h>
+#include <stdbit.h>
#include <rounding-mode.h>
#include <printf_buffer.h>
#include <printf_buffer_to_file.h>
@@ -386,7 +386,7 @@ __printf_fp_buffer_1 (struct __printf_buffer *buf, locale_t loc,
{
int cnt;
MPN_ASSIGN (p.scale, p.tmp);
- count_leading_zeros (cnt, p.scale[p.scalesize - 1]);
+ cnt = stdc_leading_zeros (p.scale[p.scalesize - 1]);
scaleexpo = (p.scalesize - 2) * BITS_PER_MP_LIMB - cnt - 1;
exp10 |= 1 << explog;
}
@@ -408,7 +408,7 @@ __printf_fp_buffer_1 (struct __printf_buffer *buf, locale_t loc,
;
/* Determine number of bits the scaling factor is misplaced. */
- count_leading_zeros (cnt_h, p.scale[p.scalesize - 1]);
+ cnt_h = stdc_leading_zeros (p.scale[p.scalesize - 1]);
if (cnt_h == 0)
{
@@ -426,17 +426,17 @@ __printf_fp_buffer_1 (struct __printf_buffer *buf, locale_t loc,
{
if (p.scale[i] != 0)
{
- count_trailing_zeros (cnt_l, p.scale[i]);
+ cnt_l = stdc_trailing_zeros (p.scale[i]);
if (p.frac[i] != 0)
{
int cnt_l2;
- count_trailing_zeros (cnt_l2, p.frac[i]);
+ cnt_l2 = stdc_trailing_zeros (p.frac[i]);
if (cnt_l2 < cnt_l)
cnt_l = cnt_l2;
}
}
else
- count_trailing_zeros (cnt_l, p.frac[i]);
+ cnt_l = stdc_trailing_zeros (p.frac[i]);
/* Now shift the numbers to their optimal position. */
if (i == 0 && BITS_PER_MP_LIMB - cnt_h > cnt_l)
@@ -528,7 +528,7 @@ __printf_fp_buffer_1 (struct __printf_buffer *buf, locale_t loc,
if (cy == 0)
--p.tmpsize;
- count_leading_zeros (cnt_h, p.tmp[p.tmpsize - 1]);
+ cnt_h = stdc_leading_zeros (p.tmp[p.tmpsize - 1]);
incr = (p.tmpsize - p.fracsize) * BITS_PER_MP_LIMB
+ BITS_PER_MP_LIMB - 1 - cnt_h;
@@ -584,7 +584,7 @@ __printf_fp_buffer_1 (struct __printf_buffer *buf, locale_t loc,
}
else
{
- count_trailing_zeros (cnt_l, p.tmp[i]);
+ cnt_l = stdc_trailing_zeros (p.tmp[i]);
/* Now shift the numbers to their optimal position. */
if (i == 0 && BITS_PER_MP_LIMB - 1 - cnt_h > cnt_l)
@@ -630,7 +630,7 @@ __printf_fp_buffer_1 (struct __printf_buffer *buf, locale_t loc,
p.tmpsize = p.fracsize;
assert (cy == 0 || p.tmp[p.tmpsize - 1] < 20);
- count_trailing_zeros (cnt_l, p.tmp[0]);
+ cnt_l = stdc_trailing_zeros (p.tmp[0]);
if (cnt_l < MIN (4, p.exponent))
{
cy = __mpn_lshift (p.frac, p.tmp, p.tmpsize,
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index b5d5b31..fc4a3de 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -733,7 +733,7 @@ void _dl_handle_execstack_tunable (void) attribute_hidden;
/* This function changes the permission of the memory region pointed
by STACK_ENDP to executable and update the internal memory protection
flags for future thread stack creation. */
-int _dl_make_stack_executable (void **stack_endp) attribute_hidden;
+int _dl_make_stack_executable (const void *stack_endp) attribute_hidden;
/* Variable pointing to the end of the stack (or close to it). This value
must be constant over the runtime of the application. Some programs
diff --git a/sysdeps/ieee754/flt-32/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c
index 5138408..eeb1aae 100644
--- a/sysdeps/ieee754/flt-32/e_atanhf.c
+++ b/sysdeps/ieee754/flt-32/e_atanhf.c
@@ -3,7 +3,7 @@
Copyright (c) 2023-2024 Alexei Sibidanov.
The original version of this file was copied from the CORE-MATH
-project (file src/binary32/acosh/acoshf.c, revision bc385c2).
+project (file src/binary32/acosh/acoshf.c, revision 4d6192d2).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -135,7 +135,7 @@ __ieee754_atanhf (float x)
}
double sgn = s[ux >> 31];
unsigned int e = ax >> 24;
- unsigned int md = ((ux << 8) | 1 << 31) >> (126 - e);
+ unsigned int md = ((ux << 8) | 1U << 31) >> (126 - e);
unsigned int mn = -md;
int nz = __builtin_clz (mn) + 1;
mn <<= nz;
diff --git a/sysdeps/ieee754/flt-32/e_coshf.c b/sysdeps/ieee754/flt-32/e_coshf.c
index 5f6ff8c..382cd55 100644
--- a/sysdeps/ieee754/flt-32/e_coshf.c
+++ b/sysdeps/ieee754/flt-32/e_coshf.c
@@ -3,7 +3,7 @@
Copyright (c) 2022-2024 Alexei Sibidanov.
The original version of this file was copied from the CORE-MATH
-project (file src/binary32/cosh/coshf.c, revision 5c58ea1).
+project (file src/binary32/cosh/coshf.c, revision de59ecfb).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -69,8 +69,8 @@ __ieee754_coshf (float x)
double h2 = h * h;
int64_t jp = asuint64 (ia + 0x1.8p52);
int64_t jm = -jp;
- double sp = asdouble (TB[jp & 31] + ((jp >> 5) << 52));
- double sm = asdouble (TB[jm & 31] + ((jm >> 5) << 52));
+ double sp = asdouble (TB[jp & 31] + ((uint64_t)(jp >> 5) << 52));
+ double sm = asdouble (TB[jm & 31] + ((uint64_t)(jm >> 5) << 52));
double te = C[0] + h2 * C[2];
double to = (C[1] + h2 * C[3]);
double rp = sp * (te + h * to);
diff --git a/sysdeps/ieee754/flt-32/e_logf.c b/sysdeps/ieee754/flt-32/e_logf.c
index 6a595cf..207151c 100644
--- a/sysdeps/ieee754/flt-32/e_logf.c
+++ b/sysdeps/ieee754/flt-32/e_logf.c
@@ -70,7 +70,7 @@ __logf (float x)
tmp = ix - OFF;
i = (tmp >> (23 - LOGF_TABLE_BITS)) % N;
k = (int32_t) tmp >> 23; /* arithmetic shift */
- iz = ix - (tmp & 0x1ff << 23);
+ iz = ix - (tmp & 0xff800000);
invc = T[i].invc;
logc = T[i].logc;
z = (double_t) asfloat (iz);
diff --git a/sysdeps/ieee754/flt-32/e_sinhf.c b/sysdeps/ieee754/flt-32/e_sinhf.c
index 754b84a..6c8c1db 100644
--- a/sysdeps/ieee754/flt-32/e_sinhf.c
+++ b/sysdeps/ieee754/flt-32/e_sinhf.c
@@ -3,7 +3,7 @@
Copyright (c) 2022-2024 Alexei Sibidanov.
The original version of this file was copied from the CORE-MATH
-project (file src/binary32/sinh/sinhf.c, revision 572ecec).
+project (file src/binary32/sinh/sinhf.c, revision bbfabd99).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -83,8 +83,8 @@ __ieee754_sinhf (float x)
double h2 = h * h;
int64_t jp = asuint64 (ia + 0x1.8p52);
int64_t jm = -jp;
- double sp = asdouble (TB[jp & 31] + ((jp >> 5) << 52));
- double sm = asdouble (TB[jm & 31] + ((jm >> 5) << 52));
+ double sp = asdouble (TB[jp & 31] + ((uint64_t)(jp >> 5) << 52));
+ double sm = asdouble (TB[jm & 31] + ((uint64_t)(jm >> 5) << 52));
double te = C[0] + h2 * C[2];
double to = (C[1] + h2 * C[3]);
double rp = sp * (te + h * to);
diff --git a/sysdeps/ieee754/flt-32/s_cbrtf.c b/sysdeps/ieee754/flt-32/s_cbrtf.c
index 5a7a9a9..df9e888 100644
--- a/sysdeps/ieee754/flt-32/s_cbrtf.c
+++ b/sysdeps/ieee754/flt-32/s_cbrtf.c
@@ -3,7 +3,7 @@
Copyright (c) 2023, 2024 Alexei Sibidanov.
The original version of this file was copied from the CORE-MATH
-project (file src/binary32/cbrt/cbrtf.c, revision bc385c2).
+project (file src/binary32/cbrt/cbrtf.c, revision f7c7408d).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -61,8 +61,8 @@ __cbrtf (float x)
e += 899;
uint32_t et = e / 3, it = e % 3;
uint64_t isc = escale[it].u;
- isc += (int64_t) (et - 342) << 52;
- isc |= (int64_t) sgn << 63;
+ isc += (uint64_t) (et - 342) << 52;
+ isc |= (uint64_t) sgn << 63;
double cvt2 = asdouble (isc);
static const double c[] =
{
diff --git a/sysdeps/ieee754/flt-32/s_cospif.c b/sysdeps/ieee754/flt-32/s_cospif.c
index 1e83803..eb4a10f 100644
--- a/sysdeps/ieee754/flt-32/s_cospif.c
+++ b/sysdeps/ieee754/flt-32/s_cospif.c
@@ -3,7 +3,7 @@
Copyright (c) 2022-2025 Alexei Sibidanov.
The original version of this file was copied from the CORE-MATH
-project (src/binary32/cospi/cospif.c, revision f786e13).
+project (src/binary32/cospi/cospif.c, revision bbfabd99).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -58,10 +58,10 @@ __cospif (float x)
{
if (__glibc_unlikely (p > 63))
return 1.0f;
- int32_t iq = m << (p - 32);
+ int32_t iq = (uint32_t)m << (p - 32);
return S[(iq + 32) & 127];
}
- int32_t k = m << p;
+ int32_t k = (uint32_t)m << p;
if (__glibc_unlikely (k == 0))
{
int32_t iq = m >> (32 - p);
diff --git a/sysdeps/ieee754/flt-32/s_erfcf.c b/sysdeps/ieee754/flt-32/s_erfcf.c
index 3dae2a0..955f129 100644
--- a/sysdeps/ieee754/flt-32/s_erfcf.c
+++ b/sysdeps/ieee754/flt-32/s_erfcf.c
@@ -3,7 +3,7 @@
Copyright (c) 2023, 2024 Alexei Sibidanov.
This file is part of the CORE-MATH project
-project (file src/binary32/erfc/erfcf.c revision bc385c2).
+project (file src/binary32/erfc/erfcf.c revision d0a2be20).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -142,7 +142,7 @@ __erfcf (float xf)
const double ln2l = 0x1.cf79abd6f5dc8p-47;
uint64_t jt = asuint64 (fma (x2, iln2, -(1024 + 0x1p-8)));
int64_t j = (int64_t) (jt << 12) >> 48;
- double S = asdouble (((j >> 7) + (0x3ff | sgn << 11)) << 52);
+ double S = asdouble ((uint64_t)((j >> 7) + (0x3ff | sgn << 11)) << 52);
static const double ch[] =
{
-0x1.ffffffffff333p-2, 0x1.5555555556a14p-3, -0x1.55556666659b4p-5,
diff --git a/sysdeps/ieee754/flt-32/s_sinpif.c b/sysdeps/ieee754/flt-32/s_sinpif.c
index 99a8bbb..c0d15e7 100644
--- a/sysdeps/ieee754/flt-32/s_sinpif.c
+++ b/sysdeps/ieee754/flt-32/s_sinpif.c
@@ -3,7 +3,7 @@
Copyright (c) 2022-2025 Alexei Sibidanov.
The original version of this file was copied from the CORE-MATH
-project (src/binary32/sinpi/sinpif.c, revision f786e13).
+project (src/binary32/sinpi/sinpif.c, revision bbfabd99.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -51,7 +51,7 @@ __sinpif (float x)
{
if (__glibc_unlikely (s < -6))
return copysignf (0.0f, x);
- int32_t iq = m << (-s - 1);
+ int32_t iq = (uint32_t)m << (-s - 1);
iq &= 127;
if (iq == 0 || iq == 64)
return copysignf (0.0f, x);
@@ -63,10 +63,10 @@ __sinpif (float x)
return z * (0x1.921fb54442d18p+1 + z2 * (-0x1.4abbce625be53p+2));
}
int32_t si = 25 - s;
- if (__glibc_unlikely (si >= 0 && (m << si) == 0))
+ if (__glibc_unlikely (si >= 0 && ((uint32_t)m << si) == 0))
return copysignf (0.0f, x);
- int32_t k = m << (31 - s);
+ int32_t k = (uint32_t)m << (31 - s);
double z = k, z2 = z * z;
double fs = SN[0] + z2 * (SN[1] + z2 * SN[2]);
double fc = CN[0] + z2 * (CN[1] + z2 * CN[2]);
diff --git a/sysdeps/mach/hurd/dl-execstack.c b/sysdeps/mach/hurd/dl-execstack.c
index 0617d3a..dc4719b 100644
--- a/sysdeps/mach/hurd/dl-execstack.c
+++ b/sysdeps/mach/hurd/dl-execstack.c
@@ -26,12 +26,11 @@ extern struct hurd_startup_data *_dl_hurd_data attribute_hidden;
so as to mprotect it. */
int
-_dl_make_stack_executable (void **stack_endp)
+_dl_make_stack_executable (const void *stack_endp)
{
/* Challenge the caller. */
- if (__builtin_expect (*stack_endp != __libc_stack_end, 0))
+ if (__glibc_unlikely (stack_endp != __libc_stack_end))
return EPERM;
- *stack_endp = NULL;
#if IS_IN (rtld)
if (__mprotect ((void *)_dl_hurd_data->stack_base, _dl_hurd_data->stack_size,
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index d4869c6..5acf505 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -273,6 +273,7 @@ tests += \
tst-spin4 \
tst-spin5 \
tst-stack1 \
+ tst-stack2 \
tst-stdio1 \
tst-stdio2 \
tst-thrd-detach \
@@ -368,6 +369,7 @@ modules-names += \
tst-atfork4mod \
tst-create1mod \
tst-fini1mod \
+ tst-stack2-mod \
tst-tls4moda \
tst-tls4modb \
# modules-names
@@ -541,4 +543,11 @@ LDFLAGS-tst-create1 = -Wl,-export-dynamic
$(objpfx)tst-create1: $(shared-thread-library)
$(objpfx)tst-create1.out: $(objpfx)tst-create1mod.so
+$(objpfx)tst-stack2.out: $(objpfx)tst-stack2-mod.so
+LDFLAGS-tst-stack2-mod.so = -Wl,-z,execstack
+ifeq ($(have-no-error-execstack),yes)
+LDFLAGS-tst-stack2-mod.so += -Wl,--no-error-execstack
+endif
+tst-stack2-ENV = GLIBC_TUNABLES=glibc.rtld.execstack=2
+
endif
diff --git a/sysdeps/pthread/tst-stack2-mod.c b/sysdeps/pthread/tst-stack2-mod.c
new file mode 100644
index 0000000..806fdbc
--- /dev/null
+++ b/sysdeps/pthread/tst-stack2-mod.c
@@ -0,0 +1,39 @@
+/* Check if pthread_getattr_np works within modules with non-exectuble
+ stacks (BZ 32897).
+ Copyright (C) 2025 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+
+bool init_result;
+
+void
+__attribute__ ((constructor))
+init (void)
+{
+ pthread_t me = pthread_self ();
+ pthread_attr_t attr;
+ init_result = pthread_getattr_np (me, &attr) == 0;
+}
+
+int
+mod_func (void)
+{
+ pthread_t me = pthread_self ();
+ pthread_attr_t attr;
+ return pthread_getattr_np (me, &attr);
+}
diff --git a/sysdeps/pthread/tst-stack2.c b/sysdeps/pthread/tst-stack2.c
new file mode 100644
index 0000000..20ab5af
--- /dev/null
+++ b/sysdeps/pthread/tst-stack2.c
@@ -0,0 +1,47 @@
+/* Check if pthread_getattr_np works within modules with non-exectuble
+ stacks (BZ 32897).
+ Copyright (C) 2025 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <stdbool.h>
+#include <support/xdlfcn.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+ {
+ pthread_t me = pthread_self ();
+ pthread_attr_t attr;
+ TEST_COMPARE (pthread_getattr_np (me, &attr), 0);
+ }
+
+ void *h = xdlopen ("tst-stack2-mod.so", RTLD_NOW);
+
+ bool *init_result = xdlsym (h, "init_result");
+ TEST_COMPARE (*init_result, true);
+
+ int (*mod_func)(void) = xdlsym (h, "mod_func");
+ TEST_COMPARE (mod_func (), 0);
+
+ xdlclose (h);
+
+ return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/riscv/math-use-builtins-ffs.h b/sysdeps/riscv/math-use-builtins-ffs.h
new file mode 100644
index 0000000..97d13e9
--- /dev/null
+++ b/sysdeps/riscv/math-use-builtins-ffs.h
@@ -0,0 +1,10 @@
+#if __GNUC_PREREQ (12, 0) && defined __riscv_zbb
+# define USE_FFS_BUILTIN 1
+# define USE_FFSLL_BUILTIN 1
+#elif __GNUC_PREREQ (13, 0) && defined __riscv_xtheadbb
+# define USE_FFS_BUILTIN 0
+# define USE_FFSLL_BUILTIN 1
+#else
+# define USE_FFS_BUILTIN 0
+# define USE_FFSLL_BUILTIN 0
+#endif
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index dcd87b2..ebcf820 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -506,12 +506,6 @@ sysdep_headers += \
# sysdep_headers
endif
-ifeq ($(subdir),termios)
-sysdep_headers += \
- termio.h \
- # sysdep_headers
-endif
-
ifeq ($(subdir),posix)
sysdep_headers += \
bits/initspin.h \
diff --git a/sysdeps/unix/sysv/linux/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/bits/ioctl-types.h
index cc2c9d7..e8e5084 100644
--- a/sysdeps/unix/sysv/linux/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/bits/ioctl-types.h
@@ -32,17 +32,6 @@ struct winsize
unsigned short int ws_ypixel;
};
-#define NCC 8
-struct termio
- {
- unsigned short int c_iflag; /* input mode flags */
- unsigned short int c_oflag; /* output mode flags */
- unsigned short int c_cflag; /* control mode flags */
- unsigned short int c_lflag; /* local mode flags */
- unsigned char c_line; /* line discipline */
- unsigned char c_cc[NCC]; /* control characters */
-};
-
/* modem lines */
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
diff --git a/sysdeps/unix/sysv/linux/dl-execstack.c b/sysdeps/unix/sysv/linux/dl-execstack.c
index 9791b33..6db9601 100644
--- a/sysdeps/unix/sysv/linux/dl-execstack.c
+++ b/sysdeps/unix/sysv/linux/dl-execstack.c
@@ -19,10 +19,10 @@
#include <ldsodefs.h>
int
-_dl_make_stack_executable (void **stack_endp)
+_dl_make_stack_executable (const void *stack_endp)
{
/* This gives us the highest/lowest page that needs to be changed. */
- uintptr_t page = ((uintptr_t) *stack_endp
+ uintptr_t page = ((uintptr_t) stack_endp
& -(intptr_t) GLRO(dl_pagesize));
if (__mprotect ((void *) page, GLRO(dl_pagesize),
@@ -35,9 +35,6 @@ _dl_make_stack_executable (void **stack_endp)
) != 0)
return errno;
- /* Clear the address. */
- *stack_endp = NULL;
-
/* Remember that we changed the permission. */
GL(dl_stack_flags) |= PF_X;
diff --git a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
index 03ebf1e..84bb6fc 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
@@ -31,18 +31,6 @@ struct winsize
unsigned short int ws_ypixel;
};
-#define NCC 8
-struct termio
- {
- unsigned short int c_iflag; /* input mode flags */
- unsigned short int c_oflag; /* output mode flags */
- unsigned short int c_cflag; /* control mode flags */
- unsigned short int c_lflag; /* local mode flags */
- char c_line; /* line discipline */
- /* Yes, this is really NCCS. */
- unsigned char c_cc[32 /* NCCS */]; /* control characters */
- };
-
/* modem lines */
#define TIOCM_LE 0x001 /* line enable */
#define TIOCM_DTR 0x002 /* data terminal ready */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
index f2b360c..267fa09 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h
@@ -32,17 +32,6 @@ struct winsize
unsigned short int ws_ypixel;
};
-#define NCC 10
-struct termio
- {
- unsigned short int c_iflag; /* input mode flags */
- unsigned short int c_oflag; /* output mode flags */
- unsigned short int c_cflag; /* control mode flags */
- unsigned short int c_lflag; /* local mode flags */
- unsigned char c_line; /* line discipline */
- unsigned char c_cc[NCC]; /* control characters */
-};
-
/* modem lines */
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
diff --git a/sysdeps/unix/sysv/linux/termio.h b/sysdeps/unix/sysv/linux/termio.h
deleted file mode 100644
index 0e610f0..0000000
--- a/sysdeps/unix/sysv/linux/termio.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Compatible <termio.h> for old `struct termio' ioctl interface.
- This is obsolete; use the POSIX.1 `struct termios' interface
- defined in <termios.h> instead. */
-
-#include <termios.h>
-#include <sys/ioctl.h>