aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-05-03 17:01:44 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-05-17 10:14:03 +0100
commit86147bbeec25624cb26bb7646cdbc3a49bc56bf5 (patch)
tree5d8052a0813836943eafd49956304bf98288e1d2 /sysdeps
parentad43cac44a6860eaefcadadfb2acb349921e96bf (diff)
downloadglibc-86147bbeec25624cb26bb7646cdbc3a49bc56bf5.zip
glibc-86147bbeec25624cb26bb7646cdbc3a49bc56bf5.tar.gz
glibc-86147bbeec25624cb26bb7646cdbc3a49bc56bf5.tar.bz2
rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const
_dl_skip_args is always 0, so the target specific code that modifies argv after relro protection is applied is no longer used. After the patch relro protection is applied to _dl_argv consistently on all targets. Reviewed-by: Florian Weimer <fweimer@redhat.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/aarch64/dl-sysdep.h4
-rw-r--r--sysdeps/alpha/dl-sysdep.h23
-rw-r--r--sysdeps/arc/dl-sysdep.h4
-rw-r--r--sysdeps/arm/dl-sysdep.h4
-rw-r--r--sysdeps/csky/dl-sysdep.h23
-rw-r--r--sysdeps/generic/ldsodefs.h13
-rw-r--r--sysdeps/ia64/dl-sysdep.h23
-rw-r--r--sysdeps/nios2/dl-sysdep.h4
-rw-r--r--sysdeps/s390/s390-32/dl-sysdep.h23
-rw-r--r--sysdeps/sparc/dl-sysdep.h23
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-sysdep.h4
11 files changed, 3 insertions, 145 deletions
diff --git a/sysdeps/aarch64/dl-sysdep.h b/sysdeps/aarch64/dl-sysdep.h
index 6677866..1516dd7 100644
--- a/sysdeps/aarch64/dl-sysdep.h
+++ b/sysdeps/aarch64/dl-sysdep.h
@@ -18,8 +18,4 @@
#include_next <dl-sysdep.h>
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
-
#define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/alpha/dl-sysdep.h b/sysdeps/alpha/dl-sysdep.h
deleted file mode 100644
index 3099ee4..0000000
--- a/sysdeps/alpha/dl-sysdep.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code. Alpha version.
- Copyright (C) 2002-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/>. */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
diff --git a/sysdeps/arc/dl-sysdep.h b/sysdeps/arc/dl-sysdep.h
index da060ce..cf4d160 100644
--- a/sysdeps/arc/dl-sysdep.h
+++ b/sysdeps/arc/dl-sysdep.h
@@ -18,8 +18,4 @@
#include_next <dl-sysdep.h>
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
-
#define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/arm/dl-sysdep.h b/sysdeps/arm/dl-sysdep.h
index ce7a84a..7a99107 100644
--- a/sysdeps/arm/dl-sysdep.h
+++ b/sysdeps/arm/dl-sysdep.h
@@ -18,8 +18,4 @@
#include_next <dl-sysdep.h>
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
-
#define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/csky/dl-sysdep.h b/sysdeps/csky/dl-sysdep.h
deleted file mode 100644
index fc8a58b..0000000
--- a/sysdeps/csky/dl-sysdep.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code. C-SKY version.
- Copyright (C) 2018-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/>. */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index b69ea2c..6716e1f 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -753,18 +753,11 @@ rtld_hidden_proto (__libc_stack_end)
/* Parameters passed to the dynamic linker. */
extern int _dl_argc attribute_hidden attribute_relro;
-extern char **_dl_argv
-#ifndef DL_ARGV_NOT_RELRO
- attribute_relro
-#endif
- ;
+extern char **_dl_argv attribute_relro;
rtld_hidden_proto (_dl_argv)
#if IS_IN (rtld)
-extern unsigned int _dl_skip_args attribute_hidden
-# ifndef DL_ARGV_NOT_RELRO
- attribute_relro
-# endif
- ;
+/* Always 0, only kept for not-yet-updated target start code. */
+extern const unsigned int _dl_skip_args attribute_hidden;
#endif
#define rtld_progname _dl_argv[0]
diff --git a/sysdeps/ia64/dl-sysdep.h b/sysdeps/ia64/dl-sysdep.h
deleted file mode 100644
index e3a58be..0000000
--- a/sysdeps/ia64/dl-sysdep.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code. IA-64 version.
- Copyright (C) 2002-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/>. */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
diff --git a/sysdeps/nios2/dl-sysdep.h b/sysdeps/nios2/dl-sysdep.h
index 0354650..257b37c 100644
--- a/sysdeps/nios2/dl-sysdep.h
+++ b/sysdeps/nios2/dl-sysdep.h
@@ -18,8 +18,4 @@
#include_next <dl-sysdep.h>
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
-
#define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/s390/s390-32/dl-sysdep.h b/sysdeps/s390/s390-32/dl-sysdep.h
deleted file mode 100644
index 699b50f..0000000
--- a/sysdeps/s390/s390-32/dl-sysdep.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code. S/390 version.
- Copyright (C) 2014-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/>. */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
diff --git a/sysdeps/sparc/dl-sysdep.h b/sysdeps/sparc/dl-sysdep.h
deleted file mode 100644
index f32f16a..0000000
--- a/sysdeps/sparc/dl-sysdep.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* System-specific settings for dynamic linker code. SPARC version.
- Copyright (C) 2002-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/>. */
-
-#include_next <dl-sysdep.h>
-
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
index 0d2a1d0..aa1de6b 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -48,8 +48,4 @@ extern int _dl_sysinfo_break attribute_hidden;
".previous");
#endif
-/* _dl_argv cannot be attribute_relro, because _dl_start_user
- might write into it after _dl_start returns. */
-#define DL_ARGV_NOT_RELRO 1
-
#endif /* dl-sysdep.h */