Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-readobj] Fix "Section" output when emitting relocations in JSON
Prior to this patch, the JSON output would emit an invalid key from the shared LLVM implementation. This caused llvm-readobj to output invalid JSON. This patch introduces a small helper function to print the relocation information differently between the LLVM and JSON formats. Before this patch: ``` "Relocations": [Section (2) .rel.text { { "Relocation": { "Offset": 0, "Type": { "Value": "R_X86_64_NONE", "RawValue": 0 }, "Symbol": { "Value": "rel_0", "RawValue": 1 } } }, ... ``` After this patch: ``` "Relocations": [ { "SectionIdx": 2, "Relocs": [ { "Relocation": { "Offset": 0, "Type": { "Name": "R_X86_64_NONE", "Value": 0 }, "Symbol": { "Name": "rel_0", "Value": 1 } } }, ... ``` Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D137094
- Loading branch information
Showing
2 changed files
with
150 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters