From fe9ce427d076627beed834d5c322e61323dfd1fc Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Mon, 11 Nov 2013 20:51:48 +0000 Subject: [PATCH] Add support for DT_VERxxx and DT_MIPS_xxx .dynamic section entries to the llvm-readobj. The patch reviewed by Michael Spencer. http://llvm-reviews.chandlerc.com/D2113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194421 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../tools/llvm-readobj/Inputs/dynamic-table.c | 7 ++++ .../llvm-readobj/Inputs/dynamic-table.mips | Bin 0 -> 5395 bytes test/tools/llvm-readobj/dynamic.test | 33 ++++++++++++++++++ tools/llvm-readobj/ELFDumper.cpp | 22 ++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 test/tools/llvm-readobj/Inputs/dynamic-table.c create mode 100644 test/tools/llvm-readobj/Inputs/dynamic-table.mips create mode 100644 test/tools/llvm-readobj/dynamic.test diff --git a/test/tools/llvm-readobj/Inputs/dynamic-table.c b/test/tools/llvm-readobj/Inputs/dynamic-table.c new file mode 100644 index 00000000000..6d36e8a7118 --- /dev/null +++ b/test/tools/llvm-readobj/Inputs/dynamic-table.c @@ -0,0 +1,7 @@ +// clang -target mipsel-linux-gnu -shared -fPIC -lc dynamic-table.c \ +// -o dynamic-table.mips +int puts(const char *); + +void foo(void) { + puts("Hello, World"); +} diff --git a/test/tools/llvm-readobj/Inputs/dynamic-table.mips b/test/tools/llvm-readobj/Inputs/dynamic-table.mips new file mode 100644 index 0000000000000000000000000000000000000000..ab36ceeb5a00197c3d4fdeade13337d93f21f180 GIT binary patch literal 5395 zcmb7IYiwLs5uV-aBo2gf?Kt3oq3d+9jYzK?H+@9-$HtGmY4ZbJ@5}b0eX)C8 zC4j`nsYE2KZb>RcL z_@mg3HnALLhT_y}-)Zh(Esz0~T=qk*DSSllf~e-TbBZ`|Ed}E!_U0xA9olyIk8#z%9T5 zEa*d^(^w1j+Hjm}yafeZ%SG@ApWFt15NHFbdlhT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E_H$R zp@P56(J05p+#`-66&T z84}fZ9&MGIh757y9~IUb$YAwy&isz4pY?+27FU4aZyZK12#{&673Jz2)xUxpn1 zH$mrIMi2E;?gr#;+(+)`A-NUEt=z}%wU(UC_h%Jy3G^v2ezbiZ7}&M>-o&tp>Jw$P z{VTNTH~kxgTpV(`2k2_He~UKt4YCtJIsXUWu>KgwZvjaao`PIV8Bn#$oai4oe>(K+ zI=ialuMp5SW#=Fl1|4Iqz%?jP?mxv4KO?|2Y`2-VEMNT=Pd}L<-b_w?wWD# zq`9MpH^I^xfi(?*caC5Ml~=+{1JCM9nl+9U+z{Rsf+YwRfOmpm1yvc(zv0cv;W;-v zcLg<0lkfC-^SjCU<^=J45-ikM1fD~JCEI+ee=PZkHhpTXsc0zAm%Ig*Y;W#6d)rV$ zafRw{1Ut=oSN&xLJpf+)ji8ES&8P8-B3_5UxABn!kpBYcWQebVr~h0*1pY68?gq~- zBmW}k0DouzoNrcYc>4D;n!gC*MgM*TUgI4>yx#;L_U}6RkiI{FSD-#^lal{4sP1)`o!K;5fEnf}Ir@n81SNp8F&w;OD{gW7D&HXLT56+K`cz*|c%icD54ZQlx zn)?!X-Cx$+Z-Q5dq48_*YL7MepTLLp-Cidj!QIvS#+qEx6%VP=%#4#pp*%Wu^q4zw z@c0z#WOr;0cWAUZ)GCx+ui&OxDpy4-(`O zdq3@D_1~H}2$gF;OqdS>{7&H4{%-h_K *O, uint64_t Type, uint64_t Value, case DT_FINI_ARRAY: case DT_PREINIT_ARRAY: case DT_DEBUG: + case DT_VERNEED: + case DT_VERSYM: case DT_NULL: + case DT_MIPS_FLAGS: + case DT_MIPS_BASE_ADDRESS: + case DT_MIPS_GOTSYM: OS << format("0x%" PRIX64, Value); break; + case DT_VERNEEDNUM: + case DT_MIPS_RLD_VERSION: + case DT_MIPS_LOCAL_GOTNO: + case DT_MIPS_SYMTABNO: + case DT_MIPS_UNREFEXTNO: + OS << Value; + break; case DT_PLTRELSZ: case DT_RELASZ: case DT_RELAENT: