diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-09-16 08:15:29 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-09-22 11:12:43 -0700 |
commit | b413280cfb16834450f66f554bc0d618bb513851 (patch) | |
tree | fda69976f225c3085c1da42c9b9ab191fae6f61f /elf/tst-ro-dynamic-mod.map | |
parent | 4eff749e8f06d8f6c5fc8b37299e9e0409ed80ec (diff) | |
download | glibc-b413280cfb16834450f66f554bc0d618bb513851.zip glibc-b413280cfb16834450f66f554bc0d618bb513851.tar.gz glibc-b413280cfb16834450f66f554bc0d618bb513851.tar.bz2 |
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>
Diffstat (limited to 'elf/tst-ro-dynamic-mod.map')
-rw-r--r-- | elf/tst-ro-dynamic-mod.map | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/elf/tst-ro-dynamic-mod.map b/elf/tst-ro-dynamic-mod.map new file mode 100644 index 0000000..2fe4a29 --- /dev/null +++ b/elf/tst-ro-dynamic-mod.map @@ -0,0 +1,16 @@ +SECTIONS +{ + . = SIZEOF_HEADERS; + .dynamic : { *(.dynamic) } :text :dynamic + .rodata : { *(.data*) *(.bss*) } :text + /DISCARD/ : { + *(.note.gnu.property) + } + .note : { *(.note.*) } :text :note +} +PHDRS +{ + text PT_LOAD FLAGS(5) FILEHDR PHDRS; + dynamic PT_DYNAMIC FLAGS(4); + note PT_NOTE FLAGS(4); +} |