From b9556857d86b0f7be692e2c6f3991499d848d599 Mon Sep 17 00:00:00 2001 From: Sean Fertile Date: Fri, 13 Apr 2018 16:42:48 +0000 Subject: [PATCH] Add PPC64_GLINK dynamic tag. Add support for the PPC64_GLINK dynamic tag which is used in the ElfV2 abi. Differential Revision: https://reviews.llvm.org/D45574 llvm-svn: 330038 --- include/llvm/BinaryFormat/DynamicTags.def | 15 +++++++++++++++ test/tools/llvm-readobj/Inputs/ppc64.exe | Bin 0 -> 69520 bytes test/tools/llvm-readobj/ppc64-glink.test | 11 +++++++++++ tools/llvm-readobj/ELFDumper.cpp | 12 ++++++++++++ 4 files changed, 38 insertions(+) create mode 100755 test/tools/llvm-readobj/Inputs/ppc64.exe create mode 100644 test/tools/llvm-readobj/ppc64-glink.test diff --git a/include/llvm/BinaryFormat/DynamicTags.def b/include/llvm/BinaryFormat/DynamicTags.def index c39f38a0c30..34c888d2759 100644 --- a/include/llvm/BinaryFormat/DynamicTags.def +++ b/include/llvm/BinaryFormat/DynamicTags.def @@ -16,6 +16,11 @@ #define MIPS_DYNAMIC_TAG_DEFINED #endif +#ifndef PPC64_DYNAMIC_TAG +#define PPC64_DYNAMIC_TAG(name, value) DYNAMIC_TAG(name, value) +#define PPC64_DYNAMIC_TAG_DEFINED +#endif + #ifndef DYNAMIC_TAG_MARKER #define DYNAMIC_TAG_MARKER(name, value) DYNAMIC_TAG(name, value) #define DYNAMIC_TAG_MARKER_DEFINED @@ -171,6 +176,10 @@ MIPS_DYNAMIC_TAG(MIPS_RWPLT, 0x70000034) // Points to the base MIPS_DYNAMIC_TAG(MIPS_RLD_MAP_REL, 0x70000035) // Relative offset of run time loader // map, used for debugging. +// PPC64 specific dynamic table entries. +PPC64_DYNAMIC_TAG(PPC64_GLINK, 0x70000000) // Address of 32 bytes before the + // first glink lazy resolver stub. + // Sun machine-independent extensions. DYNAMIC_TAG(AUXILIARY, 0x7FFFFFFD) // Shared object to load before self DYNAMIC_TAG(FILTER, 0x7FFFFFFF) // Shared object to get values from @@ -181,7 +190,13 @@ DYNAMIC_TAG(FILTER, 0x7FFFFFFF) // Shared object to get values from #endif #ifdef MIPS_DYNAMIC_TAG_DEFINED #undef MIPS_DYNAMIC_TAG +#undef MIPS_DYNAMIC_TAG_DEFINED #endif #ifdef HEXAGON_DYNAMIC_TAG_DEFINED #undef HEXAGON_DYNAMIC_TAG +#undef HEXAGON_DYNAMIC_TAG_DEFINED +#endif +#ifdef PPC64_DYNAMIC_TAG_DEFINED +#undef PPC64_DYNAMIC_TAG +#undef PPC64_DYNAMIC_TAG_DEFINED #endif diff --git a/test/tools/llvm-readobj/Inputs/ppc64.exe b/test/tools/llvm-readobj/Inputs/ppc64.exe new file mode 100755 index 0000000000000000000000000000000000000000..0db6147ca70aa4ef0605f683e391efb0566f1833 GIT binary patch literal 69520 zcmeI0e{5XE5y$7wj$=0_IFLX}PHF_m(wdln<&@g z)J6^b^yoIK<94mn@gtPx=j5yoZL&TzqZ*dt*Cqpo(%Ey{$u*&xOzJQ$w-wr_!r61( z$*m2c)+9NP@F}_0&xQTd5f9CLi;`fWs zQboqRA+fk;!!r8qtoIh1)4j{+A6!OXSVm7{c=L&9eIrToa~jj-gF1Y{n32f!#y0g`y<8;wWQZNFEsP7CsX@pwmD5N!Tj{fTY6%Llhi5^Zs8*3y~y)_L~q z)8YKKD!X@sGwmOT-J5g4LE#nWc$V*M@Xpmga?a&ddne|C!FykPe5mcM4}ycTzxa*d z@@b~M*Y+9PU$(u*bBj#NA*m>C{mbF_7lQVye+rUU%NrhoVtaS>{%;Ml!3&boh}-gfTl36?2z<^7KV7JXg>&9cQB>lUIU+?o9S4o|s(w z(BR~SppnnR6PHe2p|YIIdiv@mkM}maCw|N8`)mH457(LBA$krH|25Y?93BO4mSK--p=y8rLQbhxgM>-;`;p#7blpY^sL863}*#&>jg^m=#4cEy^vw~jka z%ZZlOSo5yf?rovo+u7XG+T7Z_TjJF6Pu5@L{=OqLoX@7bmRL&*x0frzrI!8~RQJoe zMQ9DxD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