glibc/scripts
Adhemerval Zanella cb19cef087 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>

(cherry picked from commit 4f047d9ede)
2024-07-23 19:05:38 +02:00
..
abi-versions.awk
abilist.awk
backport-support.sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
build-many-glibcs.py Use binutils 2.42 branch in build-many-glibcs.py 2024-01-30 14:20:35 +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 Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08: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
config.sub
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 elf: Add a way to check if tunable is set (BZ 27069) 2023-11-29 09:30:00 -03: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-23 19:05:38 +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 Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
soversions.awk
sysd-rules.awk
test_printers_common.py Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -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