diff options
author | Martin Storsjo <martin@martin.st> | 2017-10-26 20:11:32 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2017-10-26 20:11:32 +0000 |
commit | a6175a4b97416dafcb57fbd8916d2598720898f8 (patch) | |
tree | f104f4feaa1d1c7c088e683cc7c6ada5aae92dfa /lib/Object | |
parent | f4c162bbd1100b480ebd286576b02a008311f156 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r-- | lib/Object/COFFModuleDefinition.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Object/COFFModuleDefinition.cpp b/lib/Object/COFFModuleDefinition.cpp index 6ea6015eabc..e2208016eb5 100644 --- a/lib/Object/COFFModuleDefinition.cpp +++ b/lib/Object/COFFModuleDefinition.cpp @@ -250,13 +250,18 @@ private: for (;;) { read(); if (Tok.K == Identifier && Tok.Value[0] == '@') { - if (Tok.Value.drop_front().getAsInteger(10, E.Ordinal)) { - // Not an ordinal modifier at all, but the next export (fastcall - // decorated) - complete the current one. + if (Tok.Value == "@") { + // "foo @ 10" + read(); + Tok.Value.getAsInteger(10, E.Ordinal); + } else if (Tok.Value.drop_front().getAsInteger(10, E.Ordinal)) { + // "foo \n @bar" - Not an ordinal modifier at all, but the next + // export (fastcall decorated) - complete the current one. unget(); Info.Exports.push_back(E); return Error::success(); } + // "foo @10" read(); if (Tok.K == KwNoname) { E.Noname = true; |