[lld] r207125 - [PECOFF] Allow symbols not starting with '_' in x86
Rui Ueyama
ruiu at google.com
Thu Apr 24 10:04:19 PDT 2014
Author: ruiu
Date: Thu Apr 24 12:04:19 2014
New Revision: 207125
URL: http://llvm.org/viewvc/llvm-project?rev=207125&view=rev
Log:
[PECOFF] Allow symbols not starting with '_' in x86
Not all symbols are decorated with an underscore in x86. You can
write undecorated symbols in assembly, for example. Thus this
assertion is too strong.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp?rev=207125&r1=207124&r2=207125&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp Thu Apr 24 12:04:19 2014
@@ -206,7 +206,8 @@ StringRef PECOFFLinkingContext::decorate
StringRef PECOFFLinkingContext::undecorateSymbol(StringRef name) const {
if (_machineType != llvm::COFF::IMAGE_FILE_MACHINE_I386)
return name;
- assert(name.startswith("_"));
+ if (!name.startswith("_"))
+ return name;
return name.substr(1);
}
More information about the llvm-commits
mailing list