]> granicus.if.org Git - yasm/commit
Fix #70 by allowing overrides on the default (usually ".text") section.
authorPeter Johnson <peter@tortall.net>
Sat, 25 Feb 2006 19:39:57 +0000 (19:39 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 25 Feb 2006 19:39:57 +0000 (19:39 -0000)
commitb5c76541cb88717b50a9442b4587eadb3f5f8247
tree19c290c467c4ab77b290fa2a67b104346fa4a341
parentf908f39d0fd91ed6d93aa878781d4fa26d33b23e
Fix #70 by allowing overrides on the default (usually ".text") section.
The fix for this rippled into a lot of places, and I'm starting to see some
opportunities for cleaning up some of the object and objfmt structures.

* objfmt.h (yasm_objfmt_add_default_section): Move from standalone function
into objfmt-specific function.
(yasm_objfmt_module): Remove default_section_name string, and add objfmt
specific add_default_section function.
* yasm.c (main): Use slightly updated parameters when calling.

* section.h (yasm_section_is_default, yasm_section_set_default): New.
* section.c (yasm_section): Add def member (for default section flag).
(yasm_section_is_default, yasm_section_set_default): Implement.

* xdf-objfmt.c, bin-objfmt.c, dbg-objfmt.c, coff-objfmt.c: Implement.
Usually this required refactoring the objfmt-specific section data creation
into a separate function that could be used by both section_switch() and
the new add_default_section() functions, and changing section_switch() to
update changes to the section data if section was new or previously just a
default section, instead of the previous behavior of warning if the section
was not new.

* objfmt.c: Delete (no longer needed).
* Makefile.inc, Makefile.flat, libyasm.vcproj
Makefile.dj: Update to reflect removal.

* xdf-overdef.asm, win32-overdef.asm, elf-overdef.asm: Test.

svn path=/trunk/yasm/; revision=1390
29 files changed:
Mkfiles/Makefile.dj
Mkfiles/Makefile.flat
Mkfiles/vc/libyasm/libyasm.vcproj
Mkfiles/vc8/libyasm/libyasm.vcproj
frontends/yasm/yasm.c
libyasm/Makefile.inc
libyasm/objfmt.c [deleted file]
libyasm/objfmt.h
libyasm/section.c
libyasm/section.h
modules/objfmts/bin/bin-objfmt.c
modules/objfmts/coff/coff-objfmt.c
modules/objfmts/dbg/dbg-objfmt.c
modules/objfmts/elf/elf-objfmt.c
modules/objfmts/elf/elf.c
modules/objfmts/elf/elf.h
modules/objfmts/elf/tests/Makefile.inc
modules/objfmts/elf/tests/elf-overdef.asm [new file with mode: 0644]
modules/objfmts/elf/tests/elf-overdef.errwarn [new file with mode: 0644]
modules/objfmts/elf/tests/elf-overdef.hex [new file with mode: 0644]
modules/objfmts/win32/tests/Makefile.inc
modules/objfmts/win32/tests/win32-overdef.asm [new file with mode: 0644]
modules/objfmts/win32/tests/win32-overdef.errwarn [new file with mode: 0644]
modules/objfmts/win32/tests/win32-overdef.hex [new file with mode: 0644]
modules/objfmts/xdf/tests/Makefile.inc
modules/objfmts/xdf/tests/xdf-overdef.asm [new file with mode: 0644]
modules/objfmts/xdf/tests/xdf-overdef.errwarn [new file with mode: 0644]
modules/objfmts/xdf/tests/xdf-overdef.hex [new file with mode: 0644]
modules/objfmts/xdf/xdf-objfmt.c