[Bug find-debuginfo/33827] Add find-debuginfo --check-elf flag to run eu-elflint
mark at klomp dot org
sourceware-bugzilla@sourceware.org
Fri Mar 6 15:53:22 GMT 2026
https://sourceware.org/bugzilla/show_bug.cgi?id=33827
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Add find-debugedit |Add find-debuginfo
|--check-elf flag to run |--check-elf flag to run
|eu-elflint |eu-elflint
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
Pushed:
commit 39d89b44ca1746117ae537c5a6ea9f91e0d66f71
Author: Mark Wielaard <mark@klomp.org>
Date: Fri Jan 23 18:58:44 2026 +0100
find-debuginfo: Add --check-elf[-strict] to invoke eu-elflint
To make sure the ELF and AR file processed by and created by
find-debuginfo are valid introduce a --check-elf[-strict] option. The
--check-elf and --check-elf-strict flags will run eu-elflint --gnu on
the ELF and AR files before and after processing the files. Including
on the generated separate .debug files. When --check-elf-strict is
given then if eu-elflint reports any errors find-debuginfo will exit
with a failure status. With just --check-elf given any eu-elflint
output will be logged but not change the exit status.
Add a couple of testcases using --check-elf-strict including minidata,
gdb index, dwz creation and an AR file.
* configure.ac: Add check for eu-elflint.
* scripts/find-debuginfo.in: Add new flags in usage and help.
(check_elf, check_elf_strict, elflint_opts, check_elf_msg):
New vars. Process --check-elf, --check-elf-struct opts.
(do_check_elf): New function.
(do_ar_file): Call do_check_elf before/after AR file processing.
Propagate return value to caller.
(do_file): Check and propagate return value for
do_ar_file. Call do_check_elf before and after processing ELF
file. Also check debug file.
* tests/find-debuginfo.at (FIND_DEBUGINFO_PKG_BUILD_SETUP):
Create .o object files.
Add tests for --check-elf-strict plus debugdata, gdb-index and
dwz. Create ar file from object files and check.
https://sourceware.org/bugzilla/show_bug.cgi?id=33827
There have been several updates to eu-elflint in elfutils upstream (but no
release yet). Still not "perfect" on clang/llvm/lld, but the most common issues
have been resolved using lld however still show some false (?) positives. Using
--check-elf-strict does catch the riscv issue (before bug #33827 was fixed).
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Debugedit
mailing list