diff options
| author | Rui Ueyama <ruiu@google.com> | 2014-03-14 07:04:01 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2014-03-14 07:04:01 +0000 |
| commit | 74af50134b5f26677f8b787662bee9bda158d068 (patch) | |
| tree | 85d39cb029e7647b248995a9fe0ea86555664626 | |
| parent | 048baca082a8f3a14fcbf55ffb654891ddf524ff (diff) | |
| download | bcm5719-llvm-74af50134b5f26677f8b787662bee9bda158d068.tar.gz bcm5719-llvm-74af50134b5f26677f8b787662bee9bda158d068.zip | |
[PECOFF] Handle large objects having more than 32768 sections.
The COFF spec says that the SectionNumber field in the symbol table is 16 bit
signed type, but MSVC treats the field as if it is unsigned.
llvm-svn: 203901
| -rw-r--r-- | lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp index 8898746a78b..980eec74051 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp @@ -477,7 +477,8 @@ error_code FileCOFF::createDefinedSymbols(const SymbolVectorT &symbols, continue; const coff_section *sec; - if (error_code ec = _obj->getSection(sym->SectionNumber, sec)) + if (error_code ec = + _obj->getSection(static_cast<uint16_t>(sym->SectionNumber), sec)) return ec; assert(sec && "SectionIndex > 0, Sec must be non-null!"); @@ -526,7 +527,8 @@ error_code FileCOFF::cacheSectionAttributes() { continue; const coff_section *sec; - if (error_code ec = _obj->getSection(sym->SectionNumber, sec)) + if (error_code ec = + _obj->getSection(static_cast<uint16_t>(sym->SectionNumber), sec)) return ec; if (_merge.count(sec)) |

