glibc/scripts
Adhemerval Zanella 4f047d9ede
elf: Fix localplt.awk for DT_RELR-enabled builds (BZ 31978)
For each input readelf output, localplt.awk parses each 'Relocation
section' entry, checks its offset against the dynamic section entry, and
saves each DT_JMPREL, DT_RELA, and DT_REL offset value it finds. After
all lines are read, the script checks if any segment offset differed
from 0, meaning at least one 'Relocation section' was matched.

However, if the shared object was built with RELR support and the static
linker could place all the relocation on DT_RELR, there would be no
DT_JMPREL, DT_RELA, and DT_REL entries; only a DT_RELR.

For the current three ABIs that support (aarch64, x86, and powerpc64),
the powerpc64 ld.so shows the behavior above. Both x86_64 and aarch64
show extra relocations on '.rela.dyn', which makes the script check to
succeed.

This patch fixes by handling DT_RELR, where the offset is checked
against the dynamic section entries and if the shared object contains an
entry it means that there are no extra PLT entries (since all
relocations are relative).

It fixes the elf/check-localplt failure on powerpc.

Checked with a build/check for aarch64-linux-gnu, x86_64-linux-gnu,
i686-linux-gnu, arm-linux-gnueabihf, s390x-linux-gnu, powerpc-linux-gnu,
powerpc64-linux-gnu, and powerpc64le-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-07-19 22:50:26 +02:00
..
abi-versions.awk
abilist.awk Add GLIBC_ABI_DT_RELR for DT_RELR support 2022-04-26 10:16:11 -07:00
backport-support.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
build-many-glibcs.py Use Linux 6.9 in build-many-glibcs.py 2024-05-16 10:49:30 +00:00
check-c++-types.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
check-execstack.awk
check-initfini.awk Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
check-installed-headers.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
check-local-headers.sh Adjust check-local-headers test for libaudit 4.0 2024-07-19 15:57:46 +02:00
check-localplt.awk
check-obsolete-constructs.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
check-textrel.awk
check-wrapper-headers.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
check-wx-segment.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
config-uname.sh
config.guess Update scripts/config.* files from upstream GNU config version 2022-07-19 09:32:19 -03:00
config.sub Update scripts/config.* files from upstream GNU config version 2022-07-19 09:32:19 -03:00
cpp
cross-test-ssh.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
documented.sh crypt: Remove libcrypt support 2023-10-30 13:03:59 -03:00
dso-ordering-test.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
evaluate-test.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
firstversions.awk
gen-as-const.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
gen-libc-abis
gen-libc-modules.awk
gen-posix-conf-vars.awk
gen-rrtypes.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
gen-sorted.awk Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
gen-tunables.awk tunables: sort tunables list (BZ 30027) 2024-06-12 14:45:18 -04:00
glibc_shared_code.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
glibcelf.py elf: Add ELF_DYNAMIC_AFTER_RELOC to rewrite PLT 2024-01-05 05:49:49 -08:00
glibcextract.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
glibcpp.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
glibcsymbols.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
haveversions.awk
install-sh
lib-names.awk
lint-makefiles.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
list-fixed-bugs.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
list-sources.sh
localplt.awk elf: Fix localplt.awk for DT_RELR-enabled builds (BZ 31978) 2024-07-19 22:50:26 +02:00
merge-test-results.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
mkinstalldirs
move-if-change
move-symbol-to-libc.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
process-advisories.sh Update advisory format and introduce some automation 2024-01-30 13:58:57 -05:00
pylint
pylintrc Fix all the remaining misspellings -- BZ 25337 2023-06-02 01:39:48 +00:00
rellns-sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
sort-makefile-lines.py sort-makefile-lines.py: Allow '_' in name and "^# name" 2024-02-15 04:28:27 -08:00
soversions.awk
sysd-rules.awk
test_printers_common.py test_printers_common.py: Remove invalid escape sequence 2024-02-12 06:25:29 -08:00
test_printers_exceptions.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
test-installation.pl Update copyright dates not handled by scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-elf-edit.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-ld-trace.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
update-abilist.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
update-copyrights Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
vcstocl_quirks.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
versionlist.awk Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
versions.awk Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00