]> granicus.if.org Git - yasm/commit
COFF/PE: Always set paddr and vaddr to 0.
authorPeter Johnson <peter@tortall.net>
Sat, 27 Sep 2014 04:12:42 +0000 (21:12 -0700)
committerPeter Johnson <peter@tortall.net>
Sat, 27 Sep 2014 04:12:42 +0000 (21:12 -0700)
commit1910e914792399137dec0b047c59965207245df5
treee4fbf0bc912dd70159d9c524e0d27d2c1690f3f6
parent4c2772c3f90fe66c21642f838e73dba20284fb0a
COFF/PE: Always set paddr and vaddr to 0.

It appears that GNU binutils always interpret PE/COFF object files as if
they were executable files, namely that the paddr field is a rounded-up
section size (aka virtual size).  Yasm previously followed the Microsoft
specification which stated that for object files this field should be set
to the "physical address" of the section (e.g. the sum of all previous
section sizes).  However, several other sources state this field should be
set to 0 in object files, and it appears that Microsoft tools accept this.

For compatibility with the GNU tools, this commit makes Yasm always set the
paddr/vsize field to 0.

This commit also eliminates the COFF_SET_VMA customization for COFF
files.  Previously this was used to set LMA=VMA in COFF, but LMA=0 in PE.
Now that VMA is always 0, this is no longer required (LMA=VMA=0 in both
PE and COFF).
21 files changed:
modules/dbgfmts/dwarf2/tests/passwin64/dwarfwin64_testhd.hex
modules/objfmts/coff/coff-objfmt.c
modules/objfmts/coff/tests/cofftest.hex
modules/objfmts/coff/tests/cofftimes.hex
modules/objfmts/coff/tests/x86id.hex
modules/objfmts/win32/tests/gas/win32at.hex
modules/objfmts/win32/tests/gas/win32secrel32.hex
modules/objfmts/win32/tests/win32-curpos.hex
modules/objfmts/win32/tests/win32-longsect.hex
modules/objfmts/win32/tests/win32-safeseh.hex
modules/objfmts/win32/tests/win32-segof.hex
modules/objfmts/win32/tests/win32test.hex
modules/objfmts/win64/tests/gas/win64-gas-sce.hex
modules/objfmts/win64/tests/sce1.hex
modules/objfmts/win64/tests/sce2.hex
modules/objfmts/win64/tests/sce3.hex
modules/objfmts/win64/tests/sce4.hex
modules/objfmts/win64/tests/win64-curpos.hex
modules/objfmts/win64/tests/win64-dataref.hex
modules/objfmts/win64/tests/win64-dataref2.hex
modules/objfmts/win64/tests/win64-imagebase.hex