forked from OSchip/llvm-project
[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
This commit is contained in:
parent
048baca082
commit
74af50134b
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue