Index: llvm/trunk/include/llvm/Object/ELFTypes.h =================================================================== --- llvm/trunk/include/llvm/Object/ELFTypes.h +++ llvm/trunk/include/llvm/Object/ELFTypes.h @@ -90,46 +90,7 @@ // Use an alignment of 2 for the typedefs since that is the worst case for // ELF files in archives. -// Templates to choose Elf_Addr and Elf_Off depending on is64Bits. -template struct ELFDataTypeTypedefHelperCommon { - using Elf_Half = support::detail::packed_endian_specific_integral< - uint16_t, target_endianness, 2>; - using Elf_Word = support::detail::packed_endian_specific_integral< - uint32_t, target_endianness, 2>; - using Elf_Sword = support::detail::packed_endian_specific_integral< - int32_t, target_endianness, 2>; - using Elf_Xword = support::detail::packed_endian_specific_integral< - uint64_t, target_endianness, 2>; - using Elf_Sxword = support::detail::packed_endian_specific_integral< - int64_t, target_endianness, 2>; -}; - -template struct ELFDataTypeTypedefHelper; - -/// ELF 32bit types. -template -struct ELFDataTypeTypedefHelper> - : ELFDataTypeTypedefHelperCommon { - using value_type = uint32_t; - using Elf_Addr = support::detail::packed_endian_specific_integral< - value_type, TargetEndianness, 2>; - using Elf_Off = support::detail::packed_endian_specific_integral< - value_type, TargetEndianness, 2>; -}; - -/// ELF 64bit types. -template -struct ELFDataTypeTypedefHelper> - : ELFDataTypeTypedefHelperCommon { - using value_type = uint64_t; - using Elf_Addr = support::detail::packed_endian_specific_integral< - value_type, TargetEndianness, 2>; - using Elf_Off = support::detail::packed_endian_specific_integral< - value_type, TargetEndianness, 2>; -}; - // I really don't like doing this, but the alternative is copypasta. - #define LLVM_ELF_IMPORT_TYPES_ELFT(ELFT) \ using Elf_Addr = typename ELFT::Addr; \ using Elf_Off = typename ELFT::Off; \ Index: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp =================================================================== --- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -65,7 +65,7 @@ typedef Elf_Ehdr_Impl Elf_Ehdr; - typedef typename ELFDataTypeTypedefHelper::value_type addr_type; + typedef typename ELFT::uint addr_type; DyldELFObject(ELFObjectFile &&Obj); @@ -149,7 +149,7 @@ createRTDyldELFObject(MemoryBufferRef Buffer, const ObjectFile &SourceObject, const LoadedELFObjectInfo &L) { typedef typename ELFT::Shdr Elf_Shdr; - typedef typename ELFDataTypeTypedefHelper::value_type addr_type; + typedef typename ELFT::uint addr_type; Expected>> ObjOrErr = DyldELFObject::create(Buffer);