aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-hash.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2024-10-01 14:08:08 +0930
committerAlan Modra <amodra@gmail.com>2024-10-03 12:31:45 +0930
commit68bbe118337939aa0b52e007a7415c8a157579a1 (patch)
tree71b25a79d7662c93097e0e1dddf34de5f69fcf28 /libctf/ctf-hash.c
parenta3aa9cb83fd2576c78031f7f052ec74965d9178f (diff)
downloadbinutils-68bbe118337939aa0b52e007a7415c8a157579a1.zip
binutils-68bbe118337939aa0b52e007a7415c8a157579a1.tar.gz
binutils-68bbe118337939aa0b52e007a7415c8a157579a1.tar.bz2
Don't return "(null)" from bfd_elf_sym_name
A NULL return from bfd_elf_string_from_elf_section indicates an error. That shouldn't be masked by bfd_elf_sym_name but rather passed up to callers such as group_signature. If we want to print "(null)" then that should be done at a higher level. That's what this patch does, except that I chose to print "<null>" instead, like readelf. If we see "(null)" we're probably passing a NULL to printf. I haven't changed aoutx.h or pdp11.c print_symbol functions because they already handle NULL names by omitting the name. I also haven't changed mach-o.c, mmo.c, som.c, srec.c, tekhex.c, vms-alpha.c and wasm-module.c print_symbol function because it looks like they will never have NULL symbol names. bfd/ * elf.c (bfd_elf_sym_name): Don't turn a NULL name into a pointer to "(null)". (bfd_elf_print_symbol): Print "<null>" for NULL symbol names. * coffgen.c (coff_print_symbol): Likewise. * ecoff.c (_bfd_ecoff_print_symbol): Likewise. * pef.c (bfd_pef_print_symbol): Likewise. * syms.c (bfd_symbol_info): Return "<null>" in symbol_info.name if symbol name is NULL. ld/ * ldlang.c (ld_is_local_symbol): Don't check for "(null)" symbol name.
Diffstat (limited to 'libctf/ctf-hash.c')
0 files changed, 0 insertions, 0 deletions