[PATCH v6 18/23] sparc: Add <bits/pagesize.h>
Florian Weimer
fweimer@redhat.com
Tue May 20 09:25:24 GMT 2025
According to arch/sparc/Kconfig in the Linux sources, 32-bit
SPARC has 4K pages, while 64-bit SPARC has 8K pages. To enable
running 32-bit binaries in compat mode on 64-bit kernels, support
4K and 8K page sizes for 32-bit. Support 4K pages on 64-bit as well,
to help qemu-user emulation (which inherits host page size).
The 64-bit toolchain defaults to 1 MiB page size support. Both
32-bit and 64-bit variants alreaday support two page sizes, so
ld.so will need compensating code for load segments gaps. It
is therefore possible to ignore the 1 MiB page support produced
by the 64-bit toolchain.
---
sysdeps/sparc/bits/pagesize.h | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 sysdeps/sparc/bits/pagesize.h
diff --git a/sysdeps/sparc/bits/pagesize.h b/sysdeps/sparc/bits/pagesize.h
new file mode 100644
index 0000000000..01148a0bc3
--- /dev/null
+++ b/sysdeps/sparc/bits/pagesize.h
@@ -0,0 +1,5 @@
+/* The 64-bit kernel only supports 8K pages, but lower the minimum to
+ 4K to help qemu-user emulation. 32-bit binaries use 4K pages, but
+ support 8K pages as well for compat mode on 64-bit kernels. */
+#define __GLIBC_PAGE_SHIFT_MIN 12
+#define __GLIBC_PAGE_SHIFT_MAX 13
--
2.49.0
More information about the Libc-alpha
mailing list