]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Consolidate stackinfo.h
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 28 Nov 2024 17:36:42 +0000 (14:36 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 2 Dec 2024 17:14:58 +0000 (17:14 +0000)
And use sane default the generic implementation.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
sysdeps/aarch64/stackinfo.h [deleted file]
sysdeps/arc/stackinfo.h [deleted file]
sysdeps/csky/stackinfo.h [deleted file]
sysdeps/generic/stackinfo.h
sysdeps/loongarch/stackinfo.h [deleted file]
sysdeps/powerpc/powerpc32/stackinfo.h [moved from sysdeps/powerpc/stackinfo.h with 82% similarity]
sysdeps/riscv/stackinfo.h [deleted file]

diff --git a/sysdeps/aarch64/stackinfo.h b/sysdeps/aarch64/stackinfo.h
deleted file mode 100644 (file)
index 5a4dce7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2001-2024 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/>.  */
-
-/* This file contains a bit of information about the stack allocation
-   of the processor.  */
-
-#ifndef _STACKINFO_H
-#define _STACKINFO_H   1
-
-#include <elf.h>
-
-/* On AArch64 the stack grows down.  */
-#define _STACK_GROWS_DOWN      1
-
-/* Default to a non-executable stack. */
-#define DEFAULT_STACK_PERMS (PF_R|PF_W)
-
-#endif /* stackinfo.h */
diff --git a/sysdeps/arc/stackinfo.h b/sysdeps/arc/stackinfo.h
deleted file mode 100644 (file)
index 99a7f56..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Stack environment definitions for ARC.
-   Copyright (C) 2020-2024 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/>.  */
-
-/* This file contains a bit of information about the stack allocation
-   of the processor.  */
-
-#ifndef _STACKINFO_H
-#define _STACKINFO_H   1
-
-#include <elf.h>
-
-/* On ARC the stack grows down.  */
-#define _STACK_GROWS_DOWN      1
-
-/* Default to a non-executable stack.  */
-#define DEFAULT_STACK_PERMS (PF_R|PF_W)
-
-#endif /* stackinfo.h */
diff --git a/sysdeps/csky/stackinfo.h b/sysdeps/csky/stackinfo.h
deleted file mode 100644 (file)
index ef22fa3..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Stack environment definitions.  C-SKY version.
-   Copyright (C) 2018-2024 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 _STACKINFO_H
-#define _STACKINFO_H   1
-
-#include <elf.h>
-
-/* On C-SKY the stack grows down.  */
-#define _STACK_GROWS_DOWN      1
-
-#define DEFAULT_STACK_PERMS (PF_R|PF_W)
-
-#endif /* stackinfo.h */
index bf752ce94deb9a1e4ef5489781374209cd54f207..51e5f920554c324e48da69cb20b9321a0cae80cd 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-/* This file contains a bit of information about the stack allocation
-   of the processor.  Since there is no general truth we can't say
-   anything here.  */
+/* This file contains a bit of information about the stack allocation of the
+   processor.  Default to a non executable stack that grows downwards.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H   1
+
+#include <elf.h>
+
+#define _STACK_GROWS_DOWN      1
+#define DEFAULT_STACK_PERMS    (PF_R|PF_W)
+
+#endif
diff --git a/sysdeps/loongarch/stackinfo.h b/sysdeps/loongarch/stackinfo.h
deleted file mode 100644 (file)
index 6ee5055..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Stack environment definitions for LoongArch.
-   Copyright (C) 2022-2024 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/>.  */
-
-/* This file contains a bit of information about the stack allocation
-   of the processor.  */
-
-#ifndef _STACKINFO_H
-#define _STACKINFO_H 1
-
-#include <elf.h>
-
-/* On LoongArch the stack grows down.  */
-#define _STACK_GROWS_DOWN 1
-
-/* Default to a non-executable stack.  */
-#define DEFAULT_STACK_PERMS (PF_R | PF_W)
-
-#endif /* stackinfo.h */
similarity index 82%
rename from sysdeps/powerpc/stackinfo.h
rename to sysdeps/powerpc/powerpc32/stackinfo.h
index 410689bc27eff2aa4b1f527ca9b49301d7537c35..2ca360068ab791732aca16ee7e0d96141c0d5ed5 100644 (file)
 /* On PPC the stack grows down.  */
 #define _STACK_GROWS_DOWN      1
 
-#if __WORDSIZE == 64
-/* PPC64 doesn't need an executable stack and doesn't need PT_GNU_STACK
- * to make the stack nonexecutable.  */
-# define DEFAULT_STACK_PERMS (PF_R|PF_W)
-#else
 /* PF_X can be overridden if PT_GNU_STACK is present but is presumed absent.  */
-# define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
-#endif
+#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
 
 #endif /* stackinfo.h */
diff --git a/sysdeps/riscv/stackinfo.h b/sysdeps/riscv/stackinfo.h
deleted file mode 100644 (file)
index a786d4f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Stack environment definitions for RISC-V.
-   Copyright (C) 2011-2024 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/>.  */
-
-/* This file contains a bit of information about the stack allocation
-   of the processor.  */
-
-#ifndef _STACKINFO_H
-#define _STACKINFO_H   1
-
-#include <elf.h>
-
-/* On RISC-V the stack grows down.  */
-#define _STACK_GROWS_DOWN      1
-
-/* Default to a non-executable stack.  */
-#define DEFAULT_STACK_PERMS (PF_R | PF_W)
-
-#endif /* stackinfo.h */