libbacktrace: handle MOREDATA correctly without debug info

Based on patch from Andi Kleen.

	* elf.c (elf_nodebug): Handle state->moredata.
	* fileline.c (backtrace_syminfo_to_full_callback): Remove
	incorrect comment about MOREDATA.
	(backtrace_syminfo_to_full_callback_moredata): New function.
	* internal.h (backtrace_syminfo_to_full_callback_moredata):
	Declare.
	* strippedtest.c: New file.
	* configure.ac: check whether objcopy supports --strip-debug.
	* Makefile.am (strippedtest_SOURCES): New variable.
	(strippedtest_CFLAGS, strippedtest_LDFLAGS): Likewise.
	(strippedtest_LDADD): Likewise.
	(check_PROGRAMS): Add strippedtest.
	(MAKETESTS): Add strippedtest_stripped
	(%_stripped): New rule.
	* configure, Makefile.in: Regenerate.
This commit is contained in:
Ian Lance Taylor
2026-09-01 15:17:39 -07:00
parent 3bd5a08e4f
commit 735c54d9dc
8 changed files with 438 additions and 86 deletions
+9
View File
@@ -394,6 +394,15 @@ extern void backtrace_syminfo_to_full_callback (void *data, uintptr_t pc,
uintptr_t symval,
uintptr_t symsize);
/* A variant of backtrace_syminfo_to_full_callback for when the moredata
flag is set. */
extern void backtrace_syminfo_to_full_callback_moredata (void *data,
uintptr_t pc,
const char *symname,
uintptr_t symval,
uintptr_t symsize);
/* An error callback that corresponds to
backtrace_syminfo_to_full_callback. */