Skip to content

Commit 6c1fd29

Browse files
committedOct 26, 2017
[COFF] Support ordinals in def files with space between @ and the number
Both GNU ld and MS link.exe support declaring ordinals this way. A test will be added in lld. Differential Revision: https://reviews.llvm.org/D39327 llvm-svn: 316690
1 parent 356347b commit 6c1fd29

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

‎llvm/lib/Object/COFFModuleDefinition.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,18 @@ class Parser {
250250
for (;;) {
251251
read();
252252
if (Tok.K == Identifier && Tok.Value[0] == '@') {
253-
if (Tok.Value.drop_front().getAsInteger(10, E.Ordinal)) {
254-
// Not an ordinal modifier at all, but the next export (fastcall
255-
// decorated) - complete the current one.
253+
if (Tok.Value == "@") {
254+
// "foo @ 10"
255+
read();
256+
Tok.Value.getAsInteger(10, E.Ordinal);
257+
} else if (Tok.Value.drop_front().getAsInteger(10, E.Ordinal)) {
258+
// "foo \n @bar" - Not an ordinal modifier at all, but the next
259+
// export (fastcall decorated) - complete the current one.
256260
unget();
257261
Info.Exports.push_back(E);
258262
return Error::success();
259263
}
264+
// "foo @10"
260265
read();
261266
if (Tok.K == KwNoname) {
262267
E.Noname = true;

0 commit comments

Comments
 (0)
Please sign in to comment.