Add a ELFSectionRef class and use it to expose getSectionType.
[oota-llvm.git] / include / llvm / Object / ELFTypes.h
index 70f6d8b930b089461326e0ee48469b066fb9806e..8a648e509889ce84977cd99bf585ae7abaff6466 100644 (file)
@@ -24,6 +24,11 @@ template <endianness target_endianness, bool is64Bits> struct ELFType {
   static const bool Is64Bits = is64Bits;
 };
 
+typedef ELFType<support::little, false> ELF32LE;
+typedef ELFType<support::big, false> ELF32BE;
+typedef ELFType<support::little, true> ELF64LE;
+typedef ELFType<support::big, true> ELF64BE;
+
 // Use an alignment of 2 for the typedefs since that is the worst case for
 // ELF files in archives.
 
@@ -197,6 +202,9 @@ struct Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
     return st_shndx >= ELF::SHN_LORESERVE;
   }
   bool isUndefined() const { return st_shndx == ELF::SHN_UNDEF; }
+  bool isExternal() const {
+    return getBinding() != ELF::STB_LOCAL;
+  }
 };
 
 /// Elf_Versym: This is the structure of entries in the SHT_GNU_versym section