aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/dl-relocate-ld.h11
-rw-r--r--sysdeps/generic/ldsodefs.h10
-rw-r--r--sysdeps/mips/dl-relocate-ld.h11
-rw-r--r--sysdeps/riscv/dl-relocate-ld.h11
4 files changed, 16 insertions, 27 deletions
diff --git a/sysdeps/generic/dl-relocate-ld.h b/sysdeps/generic/dl-relocate-ld.h
index 5fae206db9..cfb86c2d6a 100644
--- a/sysdeps/generic/dl-relocate-ld.h
+++ b/sysdeps/generic/dl-relocate-ld.h
@@ -19,14 +19,7 @@
#ifndef _DL_RELOCATE_LD_H
#define _DL_RELOCATE_LD_H
-/* Return true if dynamic section in the shared library L should be
- relocated. */
-
-static inline bool
-dl_relocate_ld (const struct link_map *l)
-{
- /* Don't relocate dynamic section if it is readonly */
- return !l->l_ld_readonly;
-}
+/* The dynamic section is writable. */
+#define DL_RO_DYN_SECTION 0
#endif /* _DL_RELOCATE_LD_H */
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 9ec1511bb0..0410f777a6 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -69,6 +69,16 @@ __BEGIN_DECLS
`ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
#define ELFW(type) _ElfW (ELF, __ELF_NATIVE_CLASS, type)
+/* Return true if dynamic section in the shared library L should be
+ relocated. */
+
+static inline bool
+dl_relocate_ld (const struct link_map *l)
+{
+ /* Don't relocate dynamic section if it is readonly */
+ return !(l->l_ld_readonly || DL_RO_DYN_SECTION);
+}
+
/* All references to the value of l_info[DT_PLTGOT],
l_info[DT_STRTAB], l_info[DT_SYMTAB], l_info[DT_RELA],
l_info[DT_REL], l_info[DT_JMPREL], and l_info[VERSYMIDX (DT_VERSYM)]
diff --git a/sysdeps/mips/dl-relocate-ld.h b/sysdeps/mips/dl-relocate-ld.h
index 0c18d9a567..376ad75dd1 100644
--- a/sysdeps/mips/dl-relocate-ld.h
+++ b/sysdeps/mips/dl-relocate-ld.h
@@ -19,14 +19,7 @@
#ifndef _DL_RELOCATE_LD_H
#define _DL_RELOCATE_LD_H
-/* Return true if dynamic section in the shared library L should be
- relocated. */
-
-static inline bool
-dl_relocate_ld (const struct link_map *l)
-{
- /* Never relocate dynamic section. */
- return false;
-}
+/* The dynamic section is readonly. */
+#define DL_RO_DYN_SECTION 1
#endif /* _DL_RELOCATE_LD_H */
diff --git a/sysdeps/riscv/dl-relocate-ld.h b/sysdeps/riscv/dl-relocate-ld.h
index 10327454b1..2ab2b8ac6c 100644
--- a/sysdeps/riscv/dl-relocate-ld.h
+++ b/sysdeps/riscv/dl-relocate-ld.h
@@ -19,14 +19,7 @@
#ifndef _DL_RELOCATE_LD_H
#define _DL_RELOCATE_LD_H
-/* Return true if dynamic section in the shared library L should be
- relocated. */
-
-static inline bool
-dl_relocate_ld (const struct link_map *l)
-{
- /* Never relocate dynamic section for ABI compatibility. */
- return false;
-}
+/* The dynamic section is readonly for ABI compatibility. */
+#define DL_RO_DYN_SECTION 1
#endif /* _DL_RELOCATE_LD_H */