This is needed by lld. In particular, almost each --version-script test will use this feature.
I think the code can be polished a little bit, maybe other info can be dumped, but I think this is enough to make progress.
I would appreciate if you can take a look.
Details
Details
Diff Detail
Diff Detail
With a helper function to dump just the symbol section you could use an early return :-)