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 Remove bitrotten --enable-oldest-abi (bug 6652). 2014-09-16 17:45:03 +00:00
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-execstack: Permit sysdeps to xfail some libs 2018-07-20 03:28:14 +02:00
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 Extend local PLT reference check 2015-07-29 11:58:06 -07:00
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 Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
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 Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
gen-libc-modules.awk Auto-generate libc-modules.h 2014-11-19 12:16:00 +05:30
gen-posix-conf-vars.awk Remove uses of sprintf in gen-posix-conf-vars.awk 2015-01-02 11:16:35 +05:30
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 Don't build libnsl for new ABIs 2018-09-24 10:23:10 +02:00
install-sh Update miscellaneous files from upstream sources. 2018-12-06 17:21:47 +00:00
lib-names.awk Clean up gnu/lib-names.h generation (bug 14171). 2014-09-26 17:33:04 +00:00
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 Update scripts/list-sources.sh for ports repository merge. 2014-06-26 21:30:07 +00:00
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 Update miscellaneous files from upstream sources. 2018-12-06 17:21:47 +00:00
move-if-change Sync move-if-change from Gnulib, updating copyright 2022-01-01 11:42:26 -08:00
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 Implement benchmarking script in python 2014-03-21 17:32:50 +05:30
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 Remove bitrotten --enable-oldest-abi (bug 6652). 2014-09-16 17:45:03 +00:00
sysd-rules.awk sysd-rules: Cut down the number of rtld-% pattern rules 2016-09-20 10:41:05 +02:00
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