From 7ab83427af0f77b59941ceba41d509d7d097b065 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 10 Jun 2017 13:44:06 +0000 Subject: Vendor import of llvm trunk r305145: https://llvm.org/svn/llvm-project/llvm/trunk@305145 --- lib/Object/COFFImportFile.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/Object/COFFImportFile.cpp') diff --git a/lib/Object/COFFImportFile.cpp b/lib/Object/COFFImportFile.cpp index 37962d84d855..740bf94d40e0 100644 --- a/lib/Object/COFFImportFile.cpp +++ b/lib/Object/COFFImportFile.cpp @@ -285,11 +285,13 @@ ObjectFactory::createImportDescriptor(std::vector &Buffer) { IMAGE_SYM_CLASS_EXTERNAL, 0}, }; - reinterpret_cast(SymbolTable[0].Name).Offset = + // TODO: Name.Offset.Offset here and in the all similar places below + // suggests a names refactoring. Maybe StringTableOffset.Value? + SymbolTable[0].Name.Offset.Offset = sizeof(uint32_t); - reinterpret_cast(SymbolTable[5].Name).Offset = + SymbolTable[5].Name.Offset.Offset = sizeof(uint32_t) + ImportDescriptorSymbolName.length() + 1; - reinterpret_cast(SymbolTable[6].Name).Offset = + SymbolTable[6].Name.Offset.Offset = sizeof(uint32_t) + ImportDescriptorSymbolName.length() + 1 + NullImportDescriptorSymbolName.length() + 1; append(Buffer, SymbolTable); @@ -354,8 +356,7 @@ ObjectFactory::createNullImportDescriptor(std::vector &Buffer) { IMAGE_SYM_CLASS_EXTERNAL, 0}, }; - reinterpret_cast(SymbolTable[0].Name).Offset = - sizeof(uint32_t); + SymbolTable[0].Name.Offset.Offset = sizeof(uint32_t); append(Buffer, SymbolTable); // String Table @@ -437,8 +438,7 @@ NewArchiveMember ObjectFactory::createNullThunk(std::vector &Buffer) { IMAGE_SYM_CLASS_EXTERNAL, 0}, }; - reinterpret_cast(SymbolTable[0].Name).Offset = - sizeof(uint32_t); + SymbolTable[0].Name.Offset.Offset = sizeof(uint32_t); append(Buffer, SymbolTable); // String Table -- cgit v1.2.3