binutils-gdb/libctf
Nick Alcock d50c08025d libctf, open: fix opening CTF in binaries with no symtab
This is a perfectly possible case, and half of ctf_bfdopen_ctfsect
handled it fine.  The other half hit a divide by zero or two before we
got that far, and had no code path to load the strtab from anywhere
in the absence of a symtab to point at it in any case.

So, as a fallback, if there is no symtab, try loading ".strtab"
explicitly by name, like we used to before we started looking for the
strtab the symtab used.

Of course, such a strtab is not kept hold of by BFD, so this means we
have to bring back the code to possibly explicitly free the strtab that
we read in.

libctf/
	* ctf-impl.h (struct ctf_archive_internal) <ctfi_free_strsect>
	New.
	* ctf-open-bfd.c (ctf_bfdopen_ctfsect): Explicitly open a strtab
	if the input has no symtab, rather than dividing by
	zero. Arrange to free it later via ctfi_free_ctfsect.
	* ctf-archive.c (ctf_new_archive_internal): Do not
	ctfi_free_strsect by default.
	(ctf_arc_close): Possibly free it here.
2020-07-22 18:02:18 +01:00
..
.gitignore libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
aclocal.m4 libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
ChangeLog libctf, open: fix opening CTF in binaries with no symtab 2020-07-22 18:02:18 +01:00
config.h.in libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
configure libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
configure.ac libctf: support platforms with separate libintl 2020-06-26 15:56:39 +01:00
ctf-archive.c libctf, open: fix opening CTF in binaries with no symtab 2020-07-22 18:02:18 +01:00
ctf-create.c libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-decl.c libctf, decl: avoid leaks of the formatted string on error 2020-07-22 18:02:17 +01:00
ctf-decls.h libctf: pass the thunk down properly when wrapping qsort_r 2020-07-22 17:57:52 +01:00
ctf-dump.c libctf, dump: fix slice dumping 2020-07-22 18:02:18 +01:00
ctf-endian.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-error.c libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
ctf-hash.c libctf, next, hash: add dynhash and dynset _next iteration 2020-07-22 17:57:51 +01:00
ctf-impl.h libctf, open: fix opening CTF in binaries with no symtab 2020-07-22 18:02:18 +01:00
ctf-inlines.h libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-labels.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-link.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-lookup.c libctf, next: introduce new class of easier-to-use iterators 2020-07-22 17:57:50 +01:00
ctf-open-bfd.c libctf, open: fix opening CTF in binaries with no symtab 2020-07-22 18:02:18 +01:00
ctf-open.c libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-qsort_r.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-string.c Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ctf-subr.c libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
ctf-types.c libctf, types: enhance ctf_type_aname to print function arg types 2020-07-22 18:02:17 +01:00
ctf-util.c libctf, next, hash: add dynhash and dynset _next iteration 2020-07-22 17:57:51 +01:00
elf.h Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
libctf.ver libctf, ld, binutils: add textual error/warning reporting for libctf 2020-07-22 18:02:17 +01:00
Makefile.am libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
Makefile.in libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
mkerrors.sed libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
swap.h libctf, elfcpp, gold: do not assume that <byteswap.h> contains bswap_* 2020-06-26 15:56:39 +01:00