]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
readelf: Fix symbol display for RELR relocs
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 23 May 2024 17:16:57 +0000 (18:16 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 29 May 2024 15:08:04 +0000 (16:08 +0100)
commitd41629d35e2cb6a559e7d2bdb47fac48bf973725
tree289317b9fb19ef0bf8b20f66b293184cb066a2a4
parentb83021de7a83a353b5e9ad1ef428aec05846803e
readelf: Fix symbol display for RELR relocs

Filter symbols before binary searching for the right symbol to display
for a given address, such that only displayable symbols are present and
at most one per address.

The current logic does not handle multiple symbols for the same address
well if some of them are empty, the selected symbol is not stable with
respect to an unrelated symbol table change and on aarch64 often mapping
symbols are displayed which is not useful.

Filtering solves these problems at the cost of a linear scan of the
sorted symbol table.

The heuristic to select the best symbol likely could be improved, this
patch aims to improve symbol display for RELR without complex logic
such that the output is useful and stable for ld tests.
binutils/readelf.c