diff options
author | Peter Johnson <peter@tortall.net> | 2007-11-14 08:33:32 +0000 |
---|---|---|
committer | Peter Johnson <peter@tortall.net> | 2007-11-14 08:33:32 +0000 |
commit | 52affeb01a43d3a7931a559b154080eafaba8370 (patch) | |
tree | 9567f9b8b67b4e8a15e4f715ba1a563f35383719 /modules/dbgfmts | |
parent | 31f88dcd29c7788125029b26192f7b271af39960 (diff) | |
download | yasm-52affeb01a43d3a7931a559b154080eafaba8370.tar.gz |
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
Diffstat (limited to 'modules/dbgfmts')
-rw-r--r-- | modules/dbgfmts/codeview/cv-symline.c | 2 | ||||
-rw-r--r-- | modules/dbgfmts/codeview/cv-type.c | 2 | ||||
-rw-r--r-- | modules/dbgfmts/dwarf2/dwarf2-aranges.c | 2 | ||||
-rw-r--r-- | modules/dbgfmts/dwarf2/dwarf2-info.c | 4 | ||||
-rw-r--r-- | modules/dbgfmts/dwarf2/dwarf2-line.c | 4 | ||||
-rw-r--r-- | modules/dbgfmts/stabs/stabs-dbgfmt.c | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/modules/dbgfmts/codeview/cv-symline.c b/modules/dbgfmts/codeview/cv-symline.c index 6d0874f8..ab14b143 100644 --- a/modules/dbgfmts/codeview/cv-symline.c +++ b/modules/dbgfmts/codeview/cv-symline.c @@ -569,7 +569,7 @@ yasm_cv__generate_symline(yasm_object *object, yasm_linemap *linemap, info.linemap = linemap; info.errwarns = errwarns; info.debug_symline = - yasm_object_get_general(object, ".debug$S", 0, 1, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug$S", 1, 0, 0, &new, 0); info.num_lineinfos = 0; STAILQ_INIT(&info.cv8_lineinfos); info.cv8_cur_li = NULL; diff --git a/modules/dbgfmts/codeview/cv-type.c b/modules/dbgfmts/codeview/cv-type.c index 47adc234..0f2fd5d4 100644 --- a/modules/dbgfmts/codeview/cv-type.c +++ b/modules/dbgfmts/codeview/cv-type.c @@ -522,7 +522,7 @@ yasm_cv__generate_type(yasm_object *object) cv_type *type; debug_type = - yasm_object_get_general(object, ".debug$T", 0, 1, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug$T", 1, 0, 0, &new, 0); /* Add label type */ type = cv_type_create(indx++); diff --git a/modules/dbgfmts/dwarf2/dwarf2-aranges.c b/modules/dbgfmts/dwarf2/dwarf2-aranges.c index 0df37b56..0ab0dc58 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-aranges.c +++ b/modules/dbgfmts/dwarf2/dwarf2-aranges.c @@ -89,7 +89,7 @@ yasm_dwarf2__generate_aranges(yasm_object *object, yasm_section *debug_info) dwarf2_aranges_info info; debug_aranges = - yasm_object_get_general(object, ".debug_aranges", 0, + yasm_object_get_general(object, ".debug_aranges", 2*dbgfmt_dwarf2->sizeof_address, 0, 0, &new, 0); diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index b6b45eaa..556ca926 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -267,9 +267,9 @@ yasm_dwarf2__generate_info(yasm_object *object, yasm_section *debug_line, dwarf2_head *head; char *buf; yasm_section *debug_abbrev = - yasm_object_get_general(object, ".debug_abbrev", 0, 4, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug_abbrev", 4, 0, 0, &new, 0); yasm_section *debug_info = - yasm_object_get_general(object, ".debug_info", 0, 4, 0, 0, &new, 0); + yasm_object_get_general(object, ".debug_info", 4, 0, 0, &new, 0); yasm_section_set_align(debug_abbrev, 0, 0); yasm_section_set_align(debug_info, 0, 0); diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index e8d84d8c..d3fa76f2 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -645,8 +645,8 @@ yasm_dwarf2__generate_line(yasm_object *object, yasm_linemap *linemap, info.object = object; info.linemap = linemap; info.dbgfmt_dwarf2 = dbgfmt_dwarf2; - info.debug_line = yasm_object_get_general(object, ".debug_line", 0, 1, 0, - 0, &new, 0); + info.debug_line = yasm_object_get_general(object, ".debug_line", 1, 0, 0, + &new, 0); last = yasm_section_bcs_last(info.debug_line); /* header */ diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 5e908308..88d573ab 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -331,7 +331,7 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, info.errwarns = errwarns; info.lastline = 0; info.stabcount = 0; - info.stab = yasm_object_get_general(object, ".stab", 0, 4, 0, 0, &new, 0); + info.stab = yasm_object_get_general(object, ".stab", 4, 0, 0, &new, 0); if (!new) { yasm_bytecode *last = yasm_section_bcs_last(info.stab); if (last == NULL) { @@ -347,7 +347,7 @@ stabs_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, } info.stabstr = - yasm_object_get_general(object, ".stabstr", 0, 1, 0, 0, &new, 0); + yasm_object_get_general(object, ".stabstr", 1, 0, 0, &new, 0); if (!new) { yasm_bytecode *last = yasm_section_bcs_last(info.stabstr); if (last == NULL) { |