]> git.ipfire.org Git - thirdparty/elfutils.git/commit
elfclassify: Add --any-ar-member option to classify archive member
authorMark Wielaard <mark@klomp.org>
Tue, 26 Aug 2025 12:51:54 +0000 (14:51 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 28 Aug 2025 16:13:52 +0000 (18:13 +0200)
commit88d06525a723925f5209f14b4adaa4777c7b64dd
tree606e2bb82e79e28232ee1d885dd40a25c2308f60
parentcc459edfe10f2e76b82cccb8543c2f264f478209
elfclassify: Add --any-ar-member option to classify archive member

To determine whether an ELF archive contains a member of a particular
type add a new input option to eu-elfclassify --any-ar-member.
eu-elfclassify will match if a given file is an ELF archive and the
classification options apply to at least one of the members.

This can be used for example to check whether an ELF archive file
contains ELF members that can be stripped by using:

  eu-elfclassify --ar-member --unstripped <ar-file>

* src/elfclassify.c (current_path): Drop const.
(flag_ar_member): New static bool.
(classify_flag_ar_member): new enum member.
(parse_opt): Handle classify_flag_ar_member.
(check_checks): New function taken from...
(process_current_path): ...here.
(check_ar_members): New function.
(main): Add ar-member to options. Update argp.doc.
* tests/run-elfclassify.sh: Add various --any-ar-member tests.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/elfclassify.c
tests/run-elfclassify.sh