summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-07-07 03:53:00 +0000
committerRui Ueyama <ruiu@google.com>2016-07-07 03:53:00 +0000
commit830c078d8bbe494d74308a7aa6058c4edfb9b82d (patch)
treed4f4fcd81121bf7d9f7d1bf532b9c272d382bd16
parent7f92eab5af73bb8d0f7390c0e09cc1beb786ee94 (diff)
downloadbcm5719-llvm-830c078d8bbe494d74308a7aa6058c4edfb9b82d.tar.gz
bcm5719-llvm-830c078d8bbe494d74308a7aa6058c4edfb9b82d.zip
Define endianness-aware type for Elf_Chdr.
llvm-svn: 274728
-rw-r--r--llvm/include/llvm/Object/ELFTypes.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h
index 0d5441acf98..2116c30e3fe 100644
--- a/llvm/include/llvm/Object/ELFTypes.h
+++ b/llvm/include/llvm/Object/ELFTypes.h
@@ -34,6 +34,7 @@ template <class ELFT> struct Elf_Vernaux_Impl;
template <class ELFT> struct Elf_Versym_Impl;
template <class ELFT> struct Elf_Hash_Impl;
template <class ELFT> struct Elf_GnuHash_Impl;
+template <class ELFT> struct Elf_Chdr_Impl;
template <endianness E, bool Is64> struct ELFType {
private:
@@ -59,6 +60,7 @@ public:
typedef Elf_Versym_Impl<ELFType<E, Is64>> Versym;
typedef Elf_Hash_Impl<ELFType<E, Is64>> Hash;
typedef Elf_GnuHash_Impl<ELFType<E, Is64>> GnuHash;
+ typedef Elf_Chdr_Impl<ELFType<E, Is64>> Chdr;
typedef ArrayRef<Dyn> DynRange;
typedef ArrayRef<Shdr> ShdrRange;
typedef ArrayRef<Sym> SymRange;
@@ -558,6 +560,24 @@ struct Elf_GnuHash_Impl {
}
};
+// Compressed section headers.
+template <endianness TargetEndianness>
+struct Elf_Chdr_Impl<ELFType<TargetEndianness, false>> {
+ LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
+ Elf_Word ch_type;
+ Elf_Word ch_size;
+ Elf_Word ch_addralign;
+};
+
+template <endianness TargetEndianness>
+struct Elf_Chdr_Impl<ELFType<TargetEndianness, true>> {
+ LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
+ Elf_Word ch_type;
+ Elf_Word ch_reserved;
+ Elf_Xword ch_size;
+ Elf_Xword ch_addralign;
+};
+
// MIPS .reginfo section
template <class ELFT>
struct Elf_Mips_RegInfo;
OpenPOWER on IntegriCloud