aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/x32
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-10-18 17:00:07 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-10-18 17:02:08 +0200
commit246f37d6b1c4c6c0a6365df8783e62e3adf208e8 (patch)
tree5c6201f208e8d04c3b2680a1dc4b4c4879bfef6d /sysdeps/x86_64/x32
parent7363a9a9a097c455a7ddb9386b4c6f7bdf91065f (diff)
downloadglibc-246f37d6b1c4c6c0a6365df8783e62e3adf208e8.zip
glibc-246f37d6b1c4c6c0a6365df8783e62e3adf208e8.tar.gz
glibc-246f37d6b1c4c6c0a6365df8783e62e3adf208e8.tar.bz2
x86-64: Move LP_SIZE definition to its own header
This way, we can define the pointer guard macros without including <sysdep.h> on x86-64. Other architectures will not have such an inclusion dependency, and the implied header file inclusion would create a porting hazard. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/x86_64/x32')
-rw-r--r--sysdeps/x86_64/x32/sysdep.h6
-rw-r--r--sysdeps/x86_64/x32/x86-lp_size.h23
2 files changed, 24 insertions, 5 deletions
diff --git a/sysdeps/x86_64/x32/sysdep.h b/sysdeps/x86_64/x32/sysdep.h
index 645ea4a..92d9877 100644
--- a/sysdeps/x86_64/x32/sysdep.h
+++ b/sysdeps/x86_64/x32/sysdep.h
@@ -17,8 +17,8 @@
<https://www.gnu.org/licenses/>. */
#include <sysdeps/x86_64/sysdep.h>
+#include <x86-lp_size.h>
-#undef LP_SIZE
#undef LP_OP
#undef ASM_ADDR
@@ -41,8 +41,6 @@
#ifdef __ASSEMBLER__
-# define LP_SIZE 4
-
# define LP_OP(insn) insn##l
# define ASM_ADDR .long
@@ -66,8 +64,6 @@
#else /* __ASSEMBLER__ */
-# define LP_SIZE "4"
-
# define LP_OP(insn) #insn "l"
# define ASM_ADDR ".long"
diff --git a/sysdeps/x86_64/x32/x86-lp_size.h b/sysdeps/x86_64/x32/x86-lp_size.h
new file mode 100644
index 0000000..0b71e58
--- /dev/null
+++ b/sysdeps/x86_64/x32/x86-lp_size.h
@@ -0,0 +1,23 @@
+/* Pointer size definition for x86-64 x32.
+ Copyright (C) 2022 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/>. */
+
+#ifdef __ASSEMBLER__
+# define LP_SIZE 4
+#else
+# define LP_SIZE "4"
+#endif