abg-ctf-reader: use the right string table for CTF data

The CTF library needs the string table associated with the symbol
table of the ELF file.  This patch makes the CTF reader to use the
right string table.

Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>

	* src/abg-ctf-reader.cc (slurp_elf_info): Use
	find_strtab_for_symtab_section.
This commit is contained in:
Jose E. Marchesi via Libabigail
2021-11-10 13:50:50 +01:00
committed by Dodji Seketeli
parent cb55fde48b
commit e868728790
+2 -1
View File
@@ -1040,7 +1040,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
/* Get the raw ELF section contents for libctf. */
Elf_Scn *ctf_scn = elf_helpers::find_section(ctxt->elf_handler, ".ctf", SHT_PROGBITS);
Elf_Scn *symtab_scn = elf_helpers::find_symbol_table_section(ctxt->elf_handler);
Elf_Scn *strtab_scn = elf_helpers::find_section(ctxt->elf_handler, SHT_STRTAB);
Elf_Scn *strtab_scn = elf_helpers::find_strtab_for_symtab_section(ctxt->elf_handler,
symtab_scn);
if (ctf_scn == NULL || symtab_scn == NULL || strtab_scn == NULL)
return 0;