forked from OSchip/llvm-project
3f792230cb
Firstly, require the symbol to be used within the module. If a symbol is unused within a module, then by definition it cannot be address-significant within that module. This condition is useful on all platforms because it could make symbol tables smaller -- without this change, emitting an address-significance table could cause otherwise unused undefined symbols to be added to the object file. But this change is necessary with COFF specifically in order to preserve the property that an unreferenced undefined symbol in an IR module does not result in a link failure. This is already the case for ELF because ELF linkers only reject links with unresolved symbols if there is a relocation to that symbol, but COFF linkers require all undefined symbols to be resolved regardless of relocations. So if a module contains an unreferenced undefined symbol, we need to make sure not to add it to the address-significance table (and thus the symbol table) in case it doesn't end up resolved at link time. Secondly, do not add dllimport symbols to the table. These symbols won't be able to be resolved because their definitions live in another module and are accessed via the IAT, and the address-significance table has no effect on other modules anyway. It wouldn't make sense to add the IAT entry symbol to the address-significance table either because the IAT entry isn't address-significant -- the generated code never takes its address. Differential Revision: https://reviews.llvm.org/D51199 llvm-svn: 340648 |
||
---|---|---|
.. | ||
ARMException.cpp | ||
AccelTable.cpp | ||
AddressPool.cpp | ||
AddressPool.h | ||
AsmPrinter.cpp | ||
AsmPrinterDwarf.cpp | ||
AsmPrinterHandler.h | ||
AsmPrinterInlineAsm.cpp | ||
ByteStreamer.h | ||
CMakeLists.txt | ||
CodeViewDebug.cpp | ||
CodeViewDebug.h | ||
DIE.cpp | ||
DIEHash.cpp | ||
DIEHash.h | ||
DIEHashAttributes.def | ||
DbgEntityHistoryCalculator.cpp | ||
DbgEntityHistoryCalculator.h | ||
DebugHandlerBase.cpp | ||
DebugHandlerBase.h | ||
DebugLocEntry.h | ||
DebugLocStream.cpp | ||
DebugLocStream.h | ||
DwarfCFIException.cpp | ||
DwarfCompileUnit.cpp | ||
DwarfCompileUnit.h | ||
DwarfDebug.cpp | ||
DwarfDebug.h | ||
DwarfException.h | ||
DwarfExpression.cpp | ||
DwarfExpression.h | ||
DwarfFile.cpp | ||
DwarfFile.h | ||
DwarfStringPool.cpp | ||
DwarfStringPool.h | ||
DwarfUnit.cpp | ||
DwarfUnit.h | ||
EHStreamer.cpp | ||
EHStreamer.h | ||
ErlangGCPrinter.cpp | ||
LLVMBuild.txt | ||
OcamlGCPrinter.cpp | ||
WinCFGuard.cpp | ||
WinCFGuard.h | ||
WinException.cpp | ||
WinException.h |