diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-09-16 08:15:29 -0700 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-11-03 07:50:30 +0100 |
commit | f42373f911a28d34325a5bfc1ed5a962c89da7eb (patch) | |
tree | f79d0cb7d14edf45ca824a232ef03f07bc328c3b /include | |
parent | 01bffc013cdad1e0c45db7aa57efb2bee61f3338 (diff) | |
download | glibc-f42373f911a28d34325a5bfc1ed5a962c89da7eb.tar.gz |
ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340]
We can't relocate entries in dynamic section if it is readonly:
1. Add a l_ld_readonly field to struct link_map to indicate if dynamic
section is readonly and set it based on p_flags of PT_DYNAMIC segment.
2. Replace DL_RO_DYN_SECTION with dl_relocate_ld to decide if dynamic
section should be relocated.
3. Remove DL_RO_DYN_TEMP_CNT.
4. Don't use a static dynamic section to make readonly dynamic section
in vDSO writable.
5. Remove the temp argument from elf_get_dynamic_info.
This fixes BZ #28340.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit b413280cfb16834450f66f554bc0d618bb513851)
Diffstat (limited to 'include')
-rw-r--r-- | include/link.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/link.h b/include/link.h index 4af16cb596..c46aced9f7 100644 --- a/include/link.h +++ b/include/link.h @@ -205,6 +205,7 @@ struct link_map unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be freed, ie. not allocated with the dummy malloc in ld.so. */ + unsigned int l_ld_readonly:1; /* Nonzero if dynamic section is readonly. */ /* NODELETE status of the map. Only valid for maps of type lt_loaded. Lazy binding sets l_nodelete_active directly, @@ -342,6 +343,8 @@ struct link_map unsigned long long int l_serial; }; +#include <dl-relocate-ld.h> + /* Information used by audit modules. For most link maps, this data immediate follows the link map in memory. For the dynamic linker, it is allocated separately. See link_map_audit_state in |