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
+17
View File
@@ -133,6 +133,23 @@ libbacktrace_noformat_la_LIBADD = $(BACKTRACE_FILE) $(VIEW_FILE) $(ALLOC_FILE)
libbacktrace_noformat_la_DEPENDENCIES = $(libbacktrace_noformat_la_LIBADD)
if HAVE_ELF
if HAVE_OBJCOPY_STRIPDEBUG
strippedtest_SOURCES = strippedtest.c testlib.c
strippedtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
strippedtest_LDFLAGS = $(libbacktrace_testing_ldflags) -all-static
strippedtest_LDADD = libbacktrace.la
check_PROGRAMS += strippedtest
MAKETESTS += strippedtest_stripped
%_stripped: %
$(OBJCOPY) --strip-debug $< $@
endif HAVE_OBJCOPY_STRIPDEBUG
endif HAVE_ELF
if HAVE_ELF
if HAVE_OBJCOPY_DEBUGLINK