1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[COFF] Ignore semicolons in module definition identifiers

Patch by David Major.

The NSS project's .def files make heavy use of semicolons in a
frightening attempt at portability:
https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/capi/nsscapi.def

lld-link was treating the semicolon as part of the export name,
resulting in unresolved symbols. This patch includes ';' in the list of
characters to split on.

Differential Revision: https://reviews.llvm.org/D39968

llvm-svn: 319933
This commit is contained in:
Rui Ueyama 2017-12-06 19:18:24 +00:00
parent d6ee876e05
commit 59cdec1fc6
2 changed files with 10 additions and 4 deletions

View File

@ -117,7 +117,7 @@ public:
return Token(Identifier, S);
}
default: {
size_t End = Buf.find_first_of("=,\r\n \t\v");
size_t End = Buf.find_first_of("=,;\r\n \t\v");
StringRef Word = Buf.substr(0, End);
Kind K = llvm::StringSwitch<Kind>(Word)
.Case("BASE", KwBase)

View File

@ -5,11 +5,17 @@
LIBRARY test.dll
EXPORTS
TestFunction
TestFunction1
TestFunction2;
TestFunction3 ; This is a comment
; CHECK: File: test.dll
; CHECK: Format: COFF-import-file
; CHECK: Type: code
; CHECK: Name type: name
; CHECK: Symbol: __imp_TestFunction
; CHECK: Symbol: TestFunction
; CHECK: Symbol: __imp_TestFunction1
; CHECK: Symbol: TestFunction1
; CHECK: Symbol: __imp_TestFunction2{{$}}
; CHECK: Symbol: TestFunction2{{$}}
; CHECK: Symbol: __imp_TestFunction3{{$}}
; CHECK: Symbol: TestFunction3{{$}}