[llvm-readobj] Output valid JSON for GroupSections
authorPaul Kirth <paulkirth@google.com>
Sat, 18 Mar 2023 01:36:40 +0000 (01:36 +0000)
committerPaul Kirth <paulkirth@google.com>
Sat, 18 Mar 2023 03:14:17 +0000 (03:14 +0000)
commit14f292d00e26cb99909e4d192bc78d7e715ecc8c
tree1abd602b6e5a0132ba3a25ae14984e20ac76dde5
parent4e844a1498820a98eadca54662165a0ac5287439
[llvm-readobj] Output valid JSON for GroupSections

The current implementation output the LLVM formatted heading for group
sections, which was not valid JSON. This patch provides two small
customization points that allow the heading to vary between the two
implementations, and another that allows the section members to be
output as valid JSON objects.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D137095
llvm/test/tools/llvm-readobj/ELF/groups.test
llvm/tools/llvm-readobj/ELFDumper.cpp