[lld] r239712 - COFF: Fix resource table size.
Rui Ueyama
ruiu at google.com
Sun Jun 14 18:35:56 PDT 2015
Author: ruiu
Date: Sun Jun 14 20:35:56 2015
New Revision: 239712
URL: http://llvm.org/viewvc/llvm-project?rev=239712&view=rev
Log:
COFF: Fix resource table size.
The size field shouldn't include trailing padding.
Modified:
lld/trunk/COFF/Writer.cpp
lld/trunk/test/COFF/resource.test
Modified: lld/trunk/COFF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=239712&r1=239711&r2=239712&view=diff
==============================================================================
--- lld/trunk/COFF/Writer.cpp (original)
+++ lld/trunk/COFF/Writer.cpp Sun Jun 14 20:35:56 2015
@@ -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();
Modified: lld/trunk/test/COFF/resource.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/resource.test?rev=239712&r1=239711&r2=239712&view=diff
==============================================================================
--- lld/trunk/test/COFF/resource.test (original)
+++ lld/trunk/test/COFF/resource.test Sun Jun 14 20:35:56 2015
@@ -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
More information about the llvm-commits
mailing list