forked from OSchip/llvm-project
COFF: Corrected error message if a section failed to load.
There is no sense to use Name in these lines as it is not initialized yet. Patch from Igor Kudrin! llvm-svn: 247531
This commit is contained in:
parent
c5c7319fce
commit
8e186df2f5
|
@ -115,9 +115,9 @@ void ObjectFile::initializeChunks() {
|
||||||
const coff_section *Sec;
|
const coff_section *Sec;
|
||||||
StringRef Name;
|
StringRef Name;
|
||||||
std::error_code EC = COFFObj->getSection(I, Sec);
|
std::error_code EC = COFFObj->getSection(I, Sec);
|
||||||
error(EC, Twine("getSection failed: ") + Name);
|
error(EC, Twine("getSection failed: #") + Twine(I));
|
||||||
EC = COFFObj->getSectionName(Sec, Name);
|
EC = COFFObj->getSectionName(Sec, Name);
|
||||||
error(EC, Twine("getSectionName failed: ") + Name);
|
error(EC, Twine("getSectionName failed: #") + Twine(I));
|
||||||
if (Name == ".sxdata") {
|
if (Name == ".sxdata") {
|
||||||
SXData = Sec;
|
SXData = Sec;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
# RUN: yaml2obj %s > %t.obj
|
||||||
|
# RUN: not lld-link %t.obj 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
# CHECK: getSectionName failed: #1:
|
||||||
|
|
||||||
|
---
|
||||||
|
header:
|
||||||
|
Machine: IMAGE_FILE_MACHINE_AMD64
|
||||||
|
Characteristics: []
|
||||||
|
sections:
|
||||||
|
- Name: '/1'
|
||||||
|
Characteristics: []
|
||||||
|
SectionData: 00
|
||||||
|
symbols:
|
Loading…
Reference in New Issue