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

Message ID 20211209055719.56245-1-rongwei.wang@linux.alibaba.com
Headers
Series fix p_align on PT_LOAD segment in DSO isn't honored |

Message

Rongwei Wang Dec. 9, 2021, 5:57 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

A testcase had been builded by H.J.Lu:
https://sourceware.org/bugzilla/attachment.cgi?id=13838

And in Patch 1/1, I also show a simple testcase which
modified from H.J.Lu.

And a similar bug in ELF binary was also reported:
https://bugzilla.kernel.org/show_bug.cgi?id=215275

A related fix patch could been found:
https://lore.kernel.org/linux-mm/20211009092658.59665-4-rongwei.wang@linux.alibaba.com/
Originally, we send this patch for introducing .text
hugepages, was not aware of it's bug. And now, I am
not sure whether kernel maintainer will regards it as
a bug. But it deserved try again.

Thanks.

Changelog:

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/

Rongwei Wang (1):
  elf: align the mapping address of LOAD segments with p_align

 elf/dl-load.c         |  1 +
 elf/dl-map-segments.h | 63 +++++++++++++++++++++++++++++++++++++++----
 include/link.h        |  3 +++
 3 files changed, 62 insertions(+), 5 deletions(-)
  

Comments

Rongwei Wang Dec. 9, 2021, 6:36 a.m. UTC | #1
Sorry, I took a mistake, sent this patch twice.

The patch twice sent were completely same. Just read one patch
is OK.

Sorry for this mistake again.

On 12/9/21 1:57 PM, Rongwei Wang via Libc-alpha wrote:
> 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
> 
> A testcase had been builded by H.J.Lu:
> https://sourceware.org/bugzilla/attachment.cgi?id=13838
> 
> And in Patch 1/1, I also show a simple testcase which
> modified from H.J.Lu.
> 
> And a similar bug in ELF binary was also reported:
> https://bugzilla.kernel.org/show_bug.cgi?id=215275
> 
> A related fix patch could been found:
> https://lore.kernel.org/linux-mm/20211009092658.59665-4-rongwei.wang@linux.alibaba.com/
> Originally, we send this patch for introducing .text
> hugepages, was not aware of it's bug. And now, I am
> not sure whether kernel maintainer will regards it as
> a bug. But it deserved try again.
> 
> Thanks.
> 
> Changelog:
> 
> 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/
> 
> Rongwei Wang (1):
>    elf: align the mapping address of LOAD segments with p_align
> 
>   elf/dl-load.c         |  1 +
>   elf/dl-map-segments.h | 63 +++++++++++++++++++++++++++++++++++++++----
>   include/link.h        |  3 +++
>   3 files changed, 62 insertions(+), 5 deletions(-)
>