mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
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
This commit is contained in:
parent
22bc24cee7
commit
b9556857d8
@ -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
|
||||
|
BIN
test/tools/llvm-readobj/Inputs/ppc64.exe
Executable file
BIN
test/tools/llvm-readobj/Inputs/ppc64.exe
Executable file
Binary file not shown.
11
test/tools/llvm-readobj/ppc64-glink.test
Normal file
11
test/tools/llvm-readobj/ppc64-glink.test
Normal file
@ -0,0 +1,11 @@
|
||||
# Check DT_PPC64_GLINK dynamic tag.
|
||||
|
||||
RUN: llvm-readobj -dynamic-table %p/Inputs/ppc64.exe | FileCheck %s
|
||||
|
||||
CHECK: Format: ELF64-ppc64
|
||||
CHECK: Arch: powerpc64le
|
||||
CHECK: AddressSize: 64bit
|
||||
|
||||
CHECK: DynamicSection [ (25 entries)
|
||||
CHECK-NEXT: Tag Type Name/Value
|
||||
CHECK: 0x0000000070000000 PPC64_GLINK 0x10000830
|
@ -1551,6 +1551,7 @@ static const char *getTypeString(unsigned Arch, uint64_t Type) {
|
||||
#include "llvm/BinaryFormat/DynamicTags.def"
|
||||
#undef HEXAGON_DYNAMIC_TAG
|
||||
}
|
||||
|
||||
case EM_MIPS:
|
||||
switch (Type) {
|
||||
#define MIPS_DYNAMIC_TAG(name, value) \
|
||||
@ -1559,12 +1560,22 @@ static const char *getTypeString(unsigned Arch, uint64_t Type) {
|
||||
#include "llvm/BinaryFormat/DynamicTags.def"
|
||||
#undef MIPS_DYNAMIC_TAG
|
||||
}
|
||||
|
||||
case EM_PPC64:
|
||||
switch(Type) {
|
||||
#define PPC64_DYNAMIC_TAG(name, value) \
|
||||
case DT_##name: \
|
||||
return #name;
|
||||
#include "llvm/BinaryFormat/DynamicTags.def"
|
||||
#undef PPC64_DYNAMIC_TAG
|
||||
}
|
||||
}
|
||||
#undef DYNAMIC_TAG
|
||||
switch (Type) {
|
||||
// Now handle all dynamic tags except the architecture specific ones
|
||||
#define MIPS_DYNAMIC_TAG(name, value)
|
||||
#define HEXAGON_DYNAMIC_TAG(name, value)
|
||||
#define PPC64_DYNAMIC_TAG(name, value)
|
||||
// Also ignore marker tags such as DT_HIOS (maps to DT_VERNEEDNUM), etc.
|
||||
#define DYNAMIC_TAG_MARKER(name, value)
|
||||
#define DYNAMIC_TAG(name, value) \
|
||||
@ -1574,6 +1585,7 @@ static const char *getTypeString(unsigned Arch, uint64_t Type) {
|
||||
#undef DYNAMIC_TAG
|
||||
#undef MIPS_DYNAMIC_TAG
|
||||
#undef HEXAGON_DYNAMIC_TAG
|
||||
#undef PPC64_DYNAMIC_TAG
|
||||
#undef DYNAMIC_TAG_MARKER
|
||||
default: return "unknown";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user