]> granicus.if.org Git - yasm/commit
Add NASM-compatible multi-section binary support to bin object format.
authorPeter Johnson <peter@tortall.net>
Wed, 14 Nov 2007 08:33:32 +0000 (08:33 -0000)
committerPeter Johnson <peter@tortall.net>
Wed, 14 Nov 2007 08:33:32 +0000 (08:33 -0000)
commit52affeb01a43d3a7931a559b154080eafaba8370
tree9567f9b8b67b4e8a15e4f715ba1a563f35383719
parent31f88dcd29c7788125029b26192f7b271af39960
Add NASM-compatible multi-section binary support to bin object format.
This allows for arbitrary load (LMA) and execution (VMA) addresses.

The following new section attributes are supported:
 - start (LMA start address)
 - follows (follow another section's last LMA)
 - align (LMA alignment)
 - vstart (VMA start address)
 - vfollows (follow another section's last VMA)
 - valign (VMA alignment)
In addition, sections can be designed progbits or nobits.

The following special symbols are generated for program use:
 - section.<sectname>.start (LMA start address)
 - section.<sectname>.vstart (VMA start address)
 - section.<sectname>.length (section length)

The ORG directive adjusts the file offset relative to LMA, so that if
ORG=0x100, a section with LMA=0x100 will be at file offset 0.

VMA addresses are the same as LMA addresses unless otherwise specified.

Full map file support is supported via the [MAP] directive.  The map output
filename can be set either as a parameter to the [MAP] directive or on the
command line with --mapfile=<filename>.  MAP options are BRIEF, SECTIONS,
SEGMENTS, SYMBOLS, and ALL (all of the above).  If no filename is specified
either on the command line or in the source file, the map is output to
standard output.

Full documentation will be added to the Yasm manual in the near future.

This implementation supports several configurations NASM does not, for
instance http://osdir.com/ml/lang.nasm.devel/2004-12/msg00032.html .
It is also fully 64-bit aware.

Fixes: #71, #99.
svn path=/trunk/yasm/; revision=2010
70 files changed:
frontends/yasm/yasm.c
libyasm/intnum.c
libyasm/intnum.h
libyasm/section.c
libyasm/section.h
libyasm/valparam.c
libyasm/valparam.h
modules/dbgfmts/codeview/cv-symline.c
modules/dbgfmts/codeview/cv-type.c
modules/dbgfmts/dwarf2/dwarf2-aranges.c
modules/dbgfmts/dwarf2/dwarf2-info.c
modules/dbgfmts/dwarf2/dwarf2-line.c
modules/dbgfmts/stabs/stabs-dbgfmt.c
modules/objfmts/bin/bin-objfmt.c
modules/objfmts/bin/tests/Makefile.inc
modules/objfmts/bin/tests/multisect/Makefile.inc [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin-align.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin-align.errwarn [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin-align.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin-align.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin-ssym.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin-ssym.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin-ssym.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/bin_multi_test.sh [new file with mode: 0755]
modules/objfmts/bin/tests/multisect/follows-loop1-err.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/follows-loop1-err.errwarn [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/follows-loop2-err.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/follows-loop2-err.errwarn [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/follows-notfound-err.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/follows-notfound-err.errwarn [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/initbss.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/initbss.errwarn [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/initbss.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/initbss.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/ldlinux-sects.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/ldlinux-sects.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/ldlinux-sects.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect1.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect1.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect1.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect2.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect2.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect2.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect3.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect3.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect3.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect4.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect4.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect4.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect5.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect5.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/multisect5.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/nomultisect1.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/nomultisect1.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/nomultisect1.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/nomultisect2.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/nomultisect2.hex [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/nomultisect2.map [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/vfollows-loop1-err.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/vfollows-loop1-err.errwarn [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/vfollows-loop2-err.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/vfollows-loop2-err.errwarn [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/vfollows-notfound-err.asm [new file with mode: 0644]
modules/objfmts/bin/tests/multisect/vfollows-notfound-err.errwarn [new file with mode: 0644]
modules/objfmts/coff/coff-objfmt.c
modules/objfmts/dbg/dbg-objfmt.c
modules/objfmts/elf/elf-objfmt.c
modules/objfmts/macho/macho-objfmt.c
modules/objfmts/rdf/rdf-objfmt.c
modules/objfmts/xdf/xdf-objfmt.c