From: "H.J. Lu" <hjl.tools@gmail.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 0/7] Support DT_RELR relative relocation format
Date: Thu, 3 Feb 2022 10:09:41 -0800 [thread overview]
Message-ID: <20220203180948.2744-1-hjl.tools@gmail.com> (raw)
PIE and shared objects usually have many relative relocations. In
2017/2018, SHT_RELR/DT_RELR was proposed on
https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/GxjM0L-PBAAJ
("Proposal for a new section type SHT_RELR") and is a pre-standard. RELR
usually takes 3% or smaller space than R_*_RELATIVE relocations. The
virtual memory size of a mostly statically linked PIE is typically 5~10%
smaller.
Binutils 2.38 supports DT_RELR on x86 with the -z report-relative-reloc
option. When DT_RELR is enabled, ld adds a GLIBC_ABI_DT_RELR symbol
version dependency on libc.so to outputs. The DT_RELR support is enabled
in ld.so only if the linker supports -z report-relative-reloc option.
DT_RELR is enabled in glibc shared libraries and position independent
executables (PIE) automatically if linker supports -z pack-relative-relocs
nd the architecture defines SUPPORT_DT_RELR in config.h. At the moment,
only x86 targets define SUPPORT_DT_RELR.
The DT_RELR usage in glibc can be disabled with --disable-default-dt-relr.
Tested with binutils 2.38 on i686, x86-64 and x32.
Fangrui Song (1):
elf: Support DT_RELR relative relocation format [BZ #27924]
H.J. Lu (6):
elf: Properly handle zero DT_RELA/DT_REL values
Add GLIBC_ABI_DT_RELR for DT_RELR support
x86/configure.ac: Define PI_STATIC_AND_HIDDEN/SUPPORT_STATIC_PIE
x86: Define SUPPORT_DT_RELR
Add --disable-default-dt-relr
NEWS: Mention DT_RELR support
INSTALL | 6 +++
Makeconfig | 19 +++++++++
Makerules | 2 +
NEWS | 5 +++
config.h.in | 6 +++
configure | 84 +++++++++++++++++++++++++++++++++++++
configure.ac | 34 +++++++++++++++
elf/Makefile | 36 ++++++++++++++--
elf/Versions | 7 ++++
elf/dynamic-link.h | 40 +++++++++++++++++-
elf/elf.h | 13 +++++-
elf/get-dynamic-info.h | 19 +++++++--
elf/libc-abi-version.exp | 1 +
elf/tst-relr-pie.c | 1 +
elf/tst-relr.c | 64 ++++++++++++++++++++++++++++
manual/install.texi | 5 +++
scripts/abilist.awk | 2 +
scripts/versions.awk | 7 +++-
sysdeps/i386/configure | 6 ---
sysdeps/i386/configure.ac | 7 ----
sysdeps/x86/configure | 9 ++++
sysdeps/x86/configure.ac | 10 +++++
sysdeps/x86_64/configure | 6 ---
sysdeps/x86_64/configure.ac | 7 ----
24 files changed, 360 insertions(+), 36 deletions(-)
create mode 100644 elf/libc-abi-version.exp
create mode 100644 elf/tst-relr-pie.c
create mode 100644 elf/tst-relr.c
--
2.34.1
next reply other threads:[~2022-02-03 18:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 18:09 H.J. Lu [this message]
2022-02-03 18:09 ` [PATCH 1/7] elf: Support DT_RELR relative relocation format [BZ #27924] H.J. Lu
2022-02-03 18:09 ` [PATCH 2/7] elf: Properly handle zero DT_RELA/DT_REL values H.J. Lu
2022-02-03 18:09 ` [PATCH 3/7] Add GLIBC_ABI_DT_RELR for DT_RELR support H.J. Lu
2022-02-04 19:53 ` Joseph Myers
2022-02-04 20:04 ` H.J. Lu
2022-02-04 20:10 ` Joseph Myers
2022-02-04 20:40 ` H.J. Lu
2022-02-04 21:01 ` Joseph Myers
2022-02-04 21:08 ` H.J. Lu
2022-02-04 23:58 ` Joseph Myers
2022-02-05 17:24 ` H.J. Lu
2022-02-03 18:09 ` [PATCH 4/7] x86/configure.ac: Define PI_STATIC_AND_HIDDEN/SUPPORT_STATIC_PIE H.J. Lu
2022-02-03 18:09 ` [PATCH 5/7] x86: Define SUPPORT_DT_RELR H.J. Lu
2022-02-03 18:09 ` [PATCH 6/7] Add --disable-default-dt-relr H.J. Lu
2022-02-03 18:09 ` [PATCH 7/7] NEWS: Mention DT_RELR support H.J. Lu
2022-02-04 20:00 ` [PATCH 0/7] Support DT_RELR relative relocation format Joseph Myers
2022-02-04 20:08 ` H.J. Lu
2022-02-04 20:12 ` Joseph Myers
2022-02-04 20:32 ` Fangrui Song
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=20220203180948.2744-1-hjl.tools@gmail.com \
--to=hjl.tools@gmail.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).