diff options
author | Alan Modra <amodra@gmail.com> | 2021-10-21 17:02:06 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-10-21 22:09:21 +1030 |
commit | 84714f86b37ae36fedca2c0936c7d274a4000900 (patch) | |
tree | 443b0edc5e874b7b6220256863458f97f4ee5ecf /ld/ldelf.c | |
parent | f4efb229b72a133c6a5472ebbf484f5207dc0e56 (diff) | |
download | fsf-binutils-gdb-84714f86b37ae36fedca2c0936c7d274a4000900.zip fsf-binutils-gdb-84714f86b37ae36fedca2c0936c7d274a4000900.tar.gz fsf-binutils-gdb-84714f86b37ae36fedca2c0936c7d274a4000900.tar.bz2 |
Avoid -Waddress warnings in readelf
Mainline gcc:
readelf.c: In function 'find_section':
readelf.c:349:8: error: the comparison will always evaluate as 'true' for the pointer operand in 'filedata->section_headers + (sizetype)((long unsigned int)i * 80)' must not be NULL [-Werror=address]
349 | ((X) != NULL \
| ^~
readelf.c:761:9: note: in expansion of macro 'SECTION_NAME_VALID'
761 | if (SECTION_NAME_VALID (filedata->section_headers + i)
| ^~~~~~~~~~~~~~~~~~
This will likely be fixed in gcc, but inline functions are nicer than
macros.
* readelf.c (SECTION_NAME, SECTION_NAME_VALID),
(SECTION_NAME_PRINT, VALID_SYMBOL_NAME, VALID_DYNAMIC_NAME),
(GET_DYNAMIC_NAME): Delete. Replace with..
(section_name, section_name_valid, section_name_print),
(valid_symbol_name, valid_dynamic_name, get_dynamic_name): ..these
new inline functions. Update use throughout file.
Diffstat (limited to 'ld/ldelf.c')
0 files changed, 0 insertions, 0 deletions