1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00
systemd/tools
Zbigniew Jędrzejewski-Szmek 6d03e5523c tools/elf2efi: skip empty .got section and its .relro_padding
Resolves https://github.com/systemd/systemd/issues/31637.

lld-18 does the section setup differently than older versions. There is a bunch
of ordering chagnes, but it also inserts the following:

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
...
  9 .got          00000000  00000000000283c0  00000000000283c0  000283c0  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 10 .relro_padding 00000c40  00000000000283c0  00000000000283c0  000283c0  2**0
                  ALLOC
 11 .data         00000024  00000000000293c0  00000000000293c0  000283c0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
...

This causes a problem for us, because we try to map the .got to .rodata,
and the subsequent .data to .data, and round down the VMA to the nearest
page, which causes the PE sections to overlap.

https://github.com/llvm/llvm-project/pull/66042 adds .relro_padding to make
sure that the RELRO segment is properly write protected and allocated. For our
binaries, the .got section is empty, so we can skip it safely, and the
.relro_padding section is not useful once .got has been dropped.

We don't expect .got sections, but they are apparently inserted on i386 and
aarch64 builds. Emit a warning until we figure out why they are there.
2024-03-22 15:42:57 +01:00
..
chromiumos Update hwdb autosuspend rules 2023-11-01 14:07:54 +00:00
add-git-hook.sh tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
analyze-dump-sort.py tools: pylint analyze-dump-sort.py 2023-08-10 18:13:29 +02:00
catalog-report.py tools: pylint catalog-report.py 2023-08-10 11:08:17 +02:00
check-api-docs.sh Change all fixed-path bash shebangs to /u/b/env bash outside test/ 2021-12-12 21:13:50 +01:00
check-help.sh test/check-help: check that --help and -h are identical 2022-04-05 22:18:31 +02:00
check-includes.py tools: pylint check-includes.py 2023-08-10 11:08:17 +02:00
check-version-history.py man: add checks for missing version information 2023-10-01 11:54:29 +01:00
check-version.sh tests: add a smoke test for --version option in binaries 2022-04-05 22:18:31 +02:00
command_ignorelist tmpfiles: split out verbs in help 2024-02-09 17:57:41 +01:00
coverity.sh ci: simplify the Coverity script a bit 2022-08-11 10:57:25 +02:00
dbus_exporter.py tools: pylint dbus_exporter.py 2023-08-10 11:08:17 +02:00
dbus_ignorelist man: suffix signals with () 2024-01-23 16:27:50 +01:00
debug-sd-boot.sh boot: Fix debug experience 2023-03-10 11:41:08 +01:00
dump-auxv.py tools: pylint dump-auxv.py 2023-08-10 18:13:29 +02:00
elf2efi.py tools/elf2efi: skip empty .got section and its .relro_padding 2024-03-22 15:42:57 +01:00
find-build-dir.sh tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
find-double-newline.sh tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
find-tabs.sh tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
function_ignorelist man: add checks for missing version information 2023-10-01 11:54:29 +01:00
gdb-sd_dump_hashmaps.py tools: pylint gdb-sd_dump_hashmaps.py 2023-08-10 18:13:29 +02:00
generate-gperfs.py tools: pylint generate-gperfs.py 2023-08-10 18:13:29 +02:00
git-contrib.sh contrib: include co-authors to the contributor list of NEWS 2023-11-30 09:57:49 +00:00
list-discoverable-partitions.py tools: pylint list-discoverable-partitions.py 2023-08-10 18:13:29 +02:00
make-autosuspend-rules.py tools: pylint make-autosuspend-rules.py 2023-08-10 18:13:29 +02:00
make-directive-index.py tools: pylint make-directive-index.py 2023-08-10 18:13:29 +02:00
make-man-index.py man: make ID valid 2023-12-25 10:40:40 +01:00
meson-build.sh fuzz: don't panic without a C++ compiler 2023-11-15 12:07:42 +00:00
meson-extract-unit-files.py test: verify our own units (where applicable) 2024-02-20 15:45:50 +01:00
meson-render-jinja2.py meson: Remove version_h dependency from jinja2_cmdline 2024-03-06 15:16:52 +01:00
oss-fuzz.sh meson: Drop skip-deps option 2023-08-23 14:57:49 +02:00
sync-docs.py doc-sync: add support for uploading the documentation for main 2023-10-10 17:50:04 +01:00
update-dbus-docs.py man: suffix signals with () 2024-01-23 16:27:50 +01:00
update-hwdb-autosuspend.sh tools: update-hwdb-autosuspend.sh: Point at HEAD, not master branch 2023-08-16 02:07:00 +01:00
update-hwdb.sh hwdb: rename .html=>.csv 2023-11-15 15:21:26 +01:00
update-man-rules.py update-man-rules: skip over standard-conf.xml 2024-01-04 15:02:28 +01:00
update-syscall-tables.sh tools: syscall tables moved to a subdirectory 2023-11-01 14:07:54 +00:00
xml_helper.py tools: pylint xml_helper.py 2023-08-10 18:13:29 +02:00