[Backport 3.4] Fix C level backtraces for USE_ELF

[Backport #21289]
This commit is contained in:
Daniel Colson 2025-04-28 12:54:25 -04:00 committed by Takashi Kokubun
parent 3557739db9
commit ac311437d3

View file

@ -2173,9 +2173,8 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
}
}
if (offset == -1) {
if (offset == 0) {
/* main executable */
offset = 0;
if (dynsym_shdr && dynstr_shdr) {
char *strtab = file + dynstr_shdr->sh_offset;
ElfW(Sym) *symtab = (ElfW(Sym) *)(file + dynsym_shdr->sh_offset);