mbox

[v6,0/2] fix p_align on PT_LOAD segment in DSO isn't honored

Message ID 20211213025103.48472-1-rongwei.wang@linux.alibaba.com
Headers

Message

Rongwei Wang Dec. 13, 2021, 2:51 a.m. UTC
  Hi

This patch mainly to fix a reported bug:

"p_align on PT_LOAD segment in DSO isn't honored"
https://sourceware.org/bugzilla/show_bug.cgi?id=28676

Patch 1/1 is a simple testcase which modified from H.J.Lu.

Thanks.

Changelog:
v5 -> v6
- Patch "Add a testcase to check alignment of PT_LOAD segment"
add some comments
- Patch "elf: Properly align PT_LOAD segments"
update copyright

v4 -> v5
- Patch "Add a testcase to check alignment of PT_LOAD segment"
add new testcase for PT_LOAD segment
- Patch "elf: Properly align PT_LOAD segments"
fix map_start to use map_start_aligned when second mmap failed

v3 -> v4
- Patch "elf: Properly align PT_LOAD segments"
Call unmap when the second mmap fails.

v2 -> v3
- Patch "elf: Properly align PT_LOAD segments"
move mapalign into 'struct loadcmd'
fix some coding style

RFC/v1 -> v2

- Patch "elf: align the mapping address of LOAD segments with p_align"
fix coding format and add testcase in commit.

RFC link:
https://patchwork.sourceware.org/project/glibc/patch/20211204045848.71105-2-rongwei.wang@linux.alibaba.com/

H.J. Lu (1):
  Add a testcase to check alignment of PT_LOAD segment

Rongwei Wang (1):
  elf: Properly align PT_LOAD segments

 elf/Makefile          | 14 +++++++++++--
 elf/dl-load.c         |  1 +
 elf/dl-load.h         |  2 +-
 elf/dl-map-segments.h | 49 +++++++++++++++++++++++++++++++++++++++----
 elf/tst-align3.c      | 37 ++++++++++++++++++++++++++++++++
 elf/tst-alignmod3.c   | 31 +++++++++++++++++++++++++++
 6 files changed, 127 insertions(+), 7 deletions(-)
 create mode 100644 elf/tst-align3.c
 create mode 100644 elf/tst-alignmod3.c