diff options
author | Alan Modra <amodra@gmail.com> | 2023-09-19 09:39:31 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-09-20 08:23:47 +0930 |
commit | a1d1634d0012ddeecc59bb0e6012d4455edae6e8 (patch) | |
tree | ba213a2d27da84a2ec41bc2a1e7fc6ac23730131 /binutils/readelf.c | |
parent | a56e5dce69bfad45ee6977a916ccea283e087e8b (diff) | |
download | gdb-a1d1634d0012ddeecc59bb0e6012d4455edae6e8.zip gdb-a1d1634d0012ddeecc59bb0e6012d4455edae6e8.tar.gz gdb-a1d1634d0012ddeecc59bb0e6012d4455edae6e8.tar.bz2 |
elf-attrs.c memory allocation fail
Report errors rather than segfaulting.
bfd/
* elf-attrs.c (elf_new_obj_attr): Return NULL on bfd_alloc fail.
(bfd_elf_add_obj_attr_int): Handle NULL return from the above,
and propagate return to callers.
(elf_add_obj_attr_string, elf_add_obj_attr_int_string): Likewise.
(bfd_elf_add_obj_attr_string): Similarly.
(_bfd_elf_copy_obj_attributes): Report error on alloc fails.
(_bfd_elf_parse_attributes): Likewise.
* elf-bfd.h (bfd_elf_add_obj_attr_int): Update prototype.
(bfd_elf_add_obj_attr_string): Likewise.
(bfd_elf_add_obj_attr_int_string): Likewise.
gas/
* config/obj-elf.c (obj_elf_vendor_attribute): Report fatal
error on out of memory from bfd attribute functions.
* config/tc-arc.c (arc_set_attribute_int): Likewise.
(arc_set_attribute_string, arc_set_public_attributes): Likewise.
* config/tc-arm.c (aeabi_set_attribute_int): Likewise.
(aeabi_set_attribute_string): Likewise.
* config/tc-mips.c (mips_md_finish): Likewise.
* config/tc-msp430.c (msp430_md_finish): Likewise.
* config/tc-riscv.c (riscv_write_out_attrs): Likewise.
* config/tc-sparc.c (sparc_md_finish): Likewise.
* config/tc-tic6x.c (tic6x_set_attribute_int): Likewise.
* config/tc-csky.c (md_begin): Likewise.
(set_csky_attribute): Return ok status.
Diffstat (limited to 'binutils/readelf.c')
0 files changed, 0 insertions, 0 deletions