deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Pointer guard implementation. Arm version.
- Copyright (C) 2013-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# if (IS_IN (rtld) \
- || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# else
-# include <stdint.h>
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
-#endif /* POINTER_GUARD_H */
@@ -1,4 +1,4 @@
-/* Pointer obfuscation implenentation. Generic (no-op) version.
+/* Pointer obfuscation implenentation. Generic version.
Copyright (C) 2022-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -22,8 +22,30 @@
#include <pointer_guard-asm.h>
#ifndef __ASSEMBLER__
-# define PTR_MANGLE(x) (void) (x)
-# define PTR_DEMANGLE(x) (void) (x)
+# include <stdbit.h>
+# include <stdint.h>
+
+# if (IS_IN (rtld) \
+ || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
+# define PTR_GUARD_VALUE __pointer_chk_guard_local
+# else
+extern uintptr_t __pointer_chk_guard attribute_relro;
+# define PTR_GUARD_VALUE __pointer_chk_guard
+# endif
+
+# define PTR_MANGLE(var) \
+ do { \
+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ PTR_GUARD_VALUE); \
+ (var) = (__typeof (var)) stdc_rotate_left ((uintptr_t) (var), \
+ 2 * sizeof (uintptr_t) + 1); \
+ } while (0)
+# define PTR_DEMANGLE(var) \
+ do { \
+ (var) = (__typeof (var)) stdc_rotate_right ((uintptr_t) (var), \
+ 2 * sizeof (uintptr_t) + 1); \
+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ PTR_GUARD_VALUE); \
+ } while (0)
#endif
#endif /* POINTER_GUARD_H */
similarity index 100%
rename from sysdeps/unix/sysv/linux/i386/pointer_guard-asm.h
rename to sysdeps/i386/pointer_guard-asm.h
deleted file mode 100644
@@ -1,41 +0,0 @@
-/* Pointer guard implementation. AArch64 version.
- Copyright (C) 2014-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# if (IS_IN (rtld) \
- || (!defined SHARED && (IS_IN (libc) \
- || IS_IN (libpthread))))
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# else
-# include <stdint.h>
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Pointer guard implementation. Alpha version.
- Copyright (C) 2006-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdint.h>
-# if (IS_IN (rtld) \
- || (!defined SHARED && (IS_IN (libc) \
- || IS_IN (libpthread))))
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# endif
-# define PTR_DEMANGLE(var) PTR_MANGLE(var)
-#endif /* ASSEMBLER */
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Pointer obfuscation implenentation. C-SKY version.
- Copyright (C) 2022-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# if (IS_IN (rtld) \
- || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
-extern uintptr_t __pointer_chk_guard_local;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# else
-# include <stdint.h>
-extern uintptr_t __pointer_chk_guard;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,48 +0,0 @@
-/* Pointer obfuscation implenentation. i386 version.
- Copyright (C) 2005-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdbit.h>
-# include <stdint.h>
-# if IS_IN (rtld) || !defined SHARED
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_GUARD_VALUE __pointer_chk_guard_local
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_GUARD_VALUE __pointer_chk_guard
-# endif
-# define PTR_MANGLE(var) \
- do { \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ PTR_GUARD_VALUE); \
- (var) = (__typeof (var)) stdc_rotate_left ((uintptr_t) (var), \
- 2 * sizeof (uintptr_t) + 1); \
- } while (0)
-# define PTR_DEMANGLE(var) \
- do { \
- (var) = (__typeof (var)) stdc_rotate_right ((uintptr_t) (var), \
- 2 * sizeof (uintptr_t) + 1); \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ PTR_GUARD_VALUE); \
- } while (0)
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,41 +0,0 @@
-/* Pointer obfuscation implenentation. LoongArch version.
- Copyright (C) 2022-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdint.h>
-# if (IS_IN (rtld) \
- || (!defined SHARED && (IS_IN (libc) \
- || IS_IN (libpthread))))
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Pointer obfuscation implenentation. PowerPC version.
- Copyright (C) 2005-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdint.h>
-# if IS_IN (rtld) || !defined SHARED
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# endif
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Pointer obfuscation implenentation. s390x version.
- Copyright (C) 2005-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdint.h>
-# if IS_IN (rtld) || !defined SHARED
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_GUARD_VALUE __pointer_chk_guard_local
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_GUARD_VALUE __pointer_chk_guard
-# endif
-# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ PTR_GUARD_VALUE)
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Pointer obfuscation implenentation. SH version.
- Copyright (C) 2005-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdint.h>
-# if IS_IN (rtld) || !defined SHARED
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# endif
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Pointer obfuscation implenentation. 32-bit SPARC version.
- Copyright (C) 2006-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdint.h>
-# if IS_IN (rtld) || !defined SHARED
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# endif
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Pointer obfuscation implenentation. 64-bit SPARC version.
- Copyright (C) 2006-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdint.h>
-# if IS_IN (rtld) || !defined SHARED
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-# endif
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-#endif
-
-#endif /* POINTER_GUARD_H */
deleted file mode 100644
@@ -1,64 +0,0 @@
-/* Pointer obfuscation implenentation. x86-64 version.
- Copyright (C) 2005-2026 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/>. */
-
-#ifndef POINTER_GUARD_H
-#define POINTER_GUARD_H
-
-#include <pointer_guard-asm.h>
-
-#ifndef __ASSEMBLER__
-# include <stdbit.h>
-# include <stdint.h>
-
-# if (IS_IN (rtld) \
- || (!defined SHARED && (IS_IN (libc) || IS_IN (libpthread))))
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-# define PTR_MANGLE(var) \
- do { \
- (var) = (__typeof (var)) ((uintptr_t) (var) \
- ^ __pointer_chk_guard_local); \
- (var) = (__typeof (var)) stdc_rotate_left ((uintptr_t) (var), \
- 2 * sizeof (uintptr_t) + 1); \
- } while (0)
-# define PTR_DEMANGLE(var) \
- do { \
- (var) = (__typeof (var)) stdc_rotate_right ((uintptr_t) (var), \
- 2 * sizeof (uintptr_t) + 1); \
- (var) = (__typeof (var)) ((uintptr_t) (var) \
- ^ __pointer_chk_guard_local); \
- } while (0)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-# define PTR_MANGLE(var) \
- do { \
- (var) = (__typeof (var)) ((uintptr_t) (var) \
- ^ __pointer_chk_guard); \
- (var) = (__typeof (var)) stdc_rotate_left ((uintptr_t) (var), \
- 2 * sizeof (uintptr_t) + 1); \
- } while (0)
-# define PTR_DEMANGLE(var) \
- do { \
- (var) = (__typeof (var)) stdc_rotate_right ((uintptr_t) (var), \
- 2 * sizeof (uintptr_t) + 1); \
- (var) = (__typeof (var)) ((uintptr_t) (var) \
- ^ __pointer_chk_guard); \
- } while (0)
-# endif
-#endif
-
-#endif /* POINTER_GUARD_H */
similarity index 100%
rename from sysdeps/unix/sysv/linux/x86_64/pointer_guard-asm.h
rename to sysdeps/x86_64/pointer_guard-asm.h