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 JSON output for Relocations
The existing JSON incorrectly outputs line breaks and other invalid JSON. Example Before this patch: ``` ... "Relocations":[Section (9) .rela.dyn { 0xA3B0 R_X86_64_RELATIVE - 0x43D0 0xA3B8 R_X86_64_RELATIVE - 0x4A30 ... ``` Example After this patch: ``` ... "Relocations":[Section (9) .rela.dyn { {"Relocation":{"Offset":41904,"Type":{"Value":"R_X86_64_RELATIVE","RawValue":8}, "Symbol":{"Value":"","RawValue":0},"Addend":17360}}, {"Relocation":{"Offset":41912,"Type":{"Value":"R_X86_64_RELATIVE","RawValue":8}, "Symbol":{"Value":"","RawValue":0},"Addend":18992}}, {"Relocation":{"Offset":41920,"Type":{"Value":"R_X86_64_RELATIVE","RawValue":8}, "Symbol":{"Value":"","RawValue":0},"Addend":17440}}, ... ``` Note there are still issues with the Section, but each Relocation is now a valid JSON object that can be parsed. Future patches will address the issues regarding JSON output for the Section. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D137089
- Loading branch information
Showing
2 changed files
with
177 additions
and
16 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