Is there a ready-made solution for getting a list of the archive members that got used (or would be used) while linking in an archive (i.e. a static library)?
Say if I have an object file that provides main and depends on a and b. If I link it against a static lib lib.a, providing a, b, c, d in archive members a.o, b.o, c.o, and d.o respectively, then I would like to get a list with a.o and b.o, either as a side product of linking the library or by running command_to_get_members main.o lib.a
Are there solutions for this or do I need to parse nm outputs and resolve the symbols against the archive members manually?