public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: libc-alpha@sourceware.org
Cc: Florian Weimer <fweimer@redhat.com>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: [PATCH v8 0/4] Properly align all PT_LOAD segments with tests
Date: Tue, 18 Jan 2022 13:57:27 -0800	[thread overview]
Message-ID: <20220118215731.1320930-1-hjl.tools@gmail.com> (raw)

Changes from v7:

1. Skip non-power of two alignment when considering the maximum p_align.
2. Add tst-p_alignmod-base.c to build tst-p_alignmod-base.so with

bool
__attribute__ ((weak, noclone, noinline))
is_aligned_p (void *p, int align)
{
  return (((uintptr_t) p) & (align - 1)) == 0;
}

3. Update the Copyright year.

Changes from v6:

1. Rebase.
2. Add tests for other p_align cases.

Linker may set p_align of a PT_LOAD segment larger than p_align of the
first PT_LOAD segment to satisfy a section alignment.  We should align
the first PT_LOAD segment to the maximum p_align of all PT_LOAD segments.


H.J. Lu (4):
  elf: Properly align all PT_LOAD segments [BZ #28676]
  elf: Add a test for PT_LOAD segments with mixed p_align [BZ #28676]
  elf: Add a test for PT_LOAD segments with p_align == 1 [BZ #28688]
  elf: Add a test for PT_LOAD segments with invalid p_align [BZ #28688]

 elf/Makefile               |  38 +++++++++++
 elf/dl-load.c              |   9 ++-
 elf/tst-elf-edit.h         | 126 +++++++++++++++++++++++++++++++++++++
 elf/tst-p_align.h          |  20 ++++++
 elf/tst-p_align1.c         |  27 ++++++++
 elf/tst-p_align2.c         |  27 ++++++++
 elf/tst-p_align3.c         |  27 ++++++++
 elf/tst-p_align3.sh        |  27 ++++++++
 elf/tst-p_alignmod-base.c  |  41 ++++++++++++
 elf/tst-p_alignmod1-edit.c |  34 ++++++++++
 elf/tst-p_alignmod2-edit.c |  27 ++++++++
 elf/tst-p_alignmod3.c      |  25 ++++++++
 12 files changed, 427 insertions(+), 1 deletion(-)
 create mode 100644 elf/tst-elf-edit.h
 create mode 100644 elf/tst-p_align.h
 create mode 100644 elf/tst-p_align1.c
 create mode 100644 elf/tst-p_align2.c
 create mode 100644 elf/tst-p_align3.c
 create mode 100755 elf/tst-p_align3.sh
 create mode 100644 elf/tst-p_alignmod-base.c
 create mode 100644 elf/tst-p_alignmod1-edit.c
 create mode 100644 elf/tst-p_alignmod2-edit.c
 create mode 100644 elf/tst-p_alignmod3.c

-- 
2.34.1


             reply	other threads:[~2022-01-18 21:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 21:57 H.J. Lu [this message]
2022-01-18 21:57 ` [PATCH v8 1/4] elf: Properly align all PT_LOAD segments [BZ #28676] H.J. Lu
2022-01-21 18:26   ` Adhemerval Zanella
2022-01-18 21:57 ` [PATCH v8 2/4] elf: Add a test for PT_LOAD segments with mixed p_align " H.J. Lu
2022-01-21 20:00   ` Adhemerval Zanella
2022-01-21 21:13     ` H.J. Lu
2022-01-18 21:57 ` [PATCH v8 3/4] elf: Add a test for PT_LOAD segments with p_align == 1 [BZ #28688] H.J. Lu
2022-01-18 21:57 ` [PATCH v8 4/4] elf: Add a test for PT_LOAD segments with invalid p_align " H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220118215731.1320930-1-hjl.tools@gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).