From 2ec99d8c42b2ff1a1231e4df462a0910a9b7fdef Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 23 Sep 2021 09:06:49 -0700 Subject: ld.so: Initialize bootstrap_map.l_ld_readonly [BZ #28340] 1. Define DL_RO_DYN_SECTION to initalize bootstrap_map.l_ld_readonly before calling elf_get_dynamic_info to get dynamic info in bootstrap_map, 2. Define a single 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); } This updates BZ #28340 fix. --- sysdeps/mips/dl-relocate-ld.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'sysdeps/mips') 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 */ -- cgit 1.4.1