libbacktrace: read symbol table of debuginfo file

These become another symbol table to search.  This is needed if people
use --strip-all rather than --strip-debug when adding a debuglink
section.

Patch is from GitHub user pickard1.

Fixes #113

	* elf.c (elf_add): Add the symbol table from a debuginfo file.
	* Makefile.am (MAKETESTS): Add buildidfull and gnudebuglinkfull
	variants of buildid and gnudebuglink tests.
	(%_gnudebuglinkfull, %_buildidfull): New patterns.
	* Makefile.in: Regenerate.
This commit is contained in:
Ian Lance Taylor
2024-02-29 19:44:19 -08:00
parent 14818b7783
commit 36cfdc18ed
3 changed files with 48 additions and 7 deletions

2
elf.c
View File

@@ -6872,7 +6872,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
if (symtab_shndx == 0)
symtab_shndx = dynsym_shndx;
if (symtab_shndx != 0 && !debuginfo)
if (symtab_shndx != 0)
{
const b_elf_shdr *symtab_shdr;
unsigned int strtab_shndx;