COFF: Fix resource table size.

The size field shouldn't include trailing padding.

llvm-svn: 239712
This commit is contained in:
Rui Ueyama 2015-06-15 01:35:56 +00:00
parent cb070e3833
commit 59e9578f20
2 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,7 @@ void Writer::writeHeader() {
}
if (OutputSection *Sec = findSection(".rsrc")) {
DataDirectory[RESOURCE_TABLE].RelativeVirtualAddress = Sec->getRVA();
DataDirectory[RESOURCE_TABLE].Size = Sec->getRawSize();
DataDirectory[RESOURCE_TABLE].Size = Sec->getVirtualSize();
}
if (OutputSection *Sec = findSection(".reloc")) {
DataDirectory[BASE_RELOCATION_TABLE].RelativeVirtualAddress = Sec->getRVA();

View File

@ -11,4 +11,4 @@ EXE: {{H.e.l.l.o}}
# RUN: llvm-readobj -file-headers %t.exe | FileCheck --check-prefix=HEADER %s
HEADER: ResourceTableRVA: 0x1000
HEADER: ResourceTableSize: 0x200
HEADER: ResourceTableSize: 0x88