[llvm] [llvm-readobj][ELF] Implement JSON output for --dynamic-table (PR #95976)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 21 00:16:53 PDT 2024
================
@@ -138,6 +140,335 @@
# GNU64-NEXT: 0x0000000076543210 (<unknown:>0x76543210) 0x5555666677778888
# GNU64-NEXT: 0x0000000000000000 (NULL) 0x0
+# JSON64:"DynamicSection": [
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1,
+# JSON64-NEXT: "Value": 1,
+# JSON64-NEXT: "Libraries": [
+# JSON64-NEXT: "D"
+# JSON64-NEXT: ],
+# JSON64-NEXT: "Type": "NEEDED"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 2,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "PLTRELSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 3,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "PLTGOT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 4,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "HASH"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 5,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "STRTAB"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 6,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "SYMTAB"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 7,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "RELA"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 8,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "RELASZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 9,
+# JSON64-NEXT: "Value": 1929,
+# JSON64-NEXT: "Type": "RELAENT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 10,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "STRSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 11,
+# JSON64-NEXT: "Value": 2439,
+# JSON64-NEXT: "Type": "SYMENT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 12,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "INIT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 13,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "FINI"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 14,
+# JSON64-NEXT: "Value": 3,
+# JSON64-NEXT: "Name": "U",
+# JSON64-NEXT: "Type": "SONAME"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 15,
+# JSON64-NEXT: "Value": 5,
+# JSON64-NEXT: "Path": [
+# JSON64-NEXT: "f"
+# JSON64-NEXT: ],
+# JSON64-NEXT: "Type": "RPATH"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 16,
+# JSON64-NEXT: "Value": 1311768467294899695,
+# JSON64-NEXT: "Type": "SYMBOLIC"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 17,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "REL"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 18,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "RELSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 19,
+# JSON64-NEXT: "Value": 291,
+# JSON64-NEXT: "Type": "RELENT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 20,
+# JSON64-NEXT: "Value": 7,
+# JSON64-NEXT: "Type": "PLTREL"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 21,
+# JSON64-NEXT: "Value": 18364757930599072545,
+# JSON64-NEXT: "Type": "DEBUG"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 22,
+# JSON64-NEXT: "Value": 1234605616436508552,
+# JSON64-NEXT: "Type": "TEXTREL"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 23,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "JMPREL"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 24,
+# JSON64-NEXT: "Value": 9833440827789222417,
+# JSON64-NEXT: "Type": "BIND_NOW"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 25,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "INIT_ARRAY"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 26,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "FINI_ARRAY"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 27,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "INIT_ARRAYSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 28,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "FINI_ARRAYSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 29,
+# JSON64-NEXT: "Value": 7,
+# JSON64-NEXT: "Path": [
+# JSON64-NEXT: "w"
+# JSON64-NEXT: ],
+# JSON64-NEXT: "Type": "RUNPATH"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 30,
+# JSON64-NEXT: "Value": 18446744073709551615,
+# JSON64-NEXT: "Flags": "ORIGIN SYMBOLIC TEXTREL BIND_NOW STATIC_TLS ",
+# JSON64-NEXT: "Type": "FLAGS"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 32,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "PREINIT_ARRAY"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 33,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "PREINIT_ARRAYSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 34,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "SYMTAB_SHNDX"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 35,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "RELRSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 36,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "RELR"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 37,
+# JSON64-NEXT: "Value": 17185,
+# JSON64-NEXT: "Type": "RELRENT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1610612751,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "ANDROID_REL"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1610612752,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "ANDROID_RELSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1610612753,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "ANDROID_RELA"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1610612754,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "ANDROID_RELASZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879040000,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "ANDROID_RELR"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879040001,
+# JSON64-NEXT: "Value": 16,
+# JSON64-NEXT: "Type": "ANDROID_RELRSZ"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879040003,
+# JSON64-NEXT: "Value": 4660,
+# JSON64-NEXT: "Type": "ANDROID_RELRENT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879047925,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "GNU_HASH"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879047926,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "TLSDESC_PLT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879047927,
+# JSON64-NEXT: "Value": 4096,
+# JSON64-NEXT: "Type": "TLSDESC_GOT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879048185,
+# JSON64-NEXT: "Value": 0,
+# JSON64-NEXT: "Type": "RELACOUNT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879048186,
+# JSON64-NEXT: "Value": 0,
+# JSON64-NEXT: "Type": "RELCOUNT"
+# JSON64-NEXT: },
+# JSON64-NEXT: {
+# JSON64-NEXT: "Tag": 1879048187,
+# JSON64-NEXT: "Value": 18446744073709551615,
+# JSON64-NEXT: "Flags": "NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON PIE ",
----------------
jh7370 wrote:
Same comment here as above: I feel like this would be better as a list, not a concatenated string.
https://github.com/llvm/llvm-project/pull/95976
More information about the llvm-commits
mailing list