]> granicus.if.org Git - yasm/commit
In GAS mode, detect sections that are marked as contain code thanks to "x"
authorPeter Johnson <peter@tortall.net>
Fri, 11 Nov 2005 04:31:20 +0000 (04:31 -0000)
committerPeter Johnson <peter@tortall.net>
Fri, 11 Nov 2005 04:31:20 +0000 (04:31 -0000)
commit94265938fd7f87f1c8ecc6e02374b6ded6bd7b8b
treef329aa941b855b92934015ffe53e403b9e378ad6
parent731093717a9c5f8ab217f2c14f02541c8bdefd4b
In GAS mode, detect sections that are marked as contain code thanks to "x"
flag, not just sections named ".text".

* section.h (yasm_object_get_general): Add code flag parameter to indicate
if section is intended to contain code.
(yasm_section_is_code): New, to get value of code flag.
* section.c (yasm_section): Add flag to section structure.
(yasm_object_get_general, yasm_section_is_code): Implement flag.

* *-objfmt.c, stabs-dbgfmt.c: Update call to yasm_object_get_general,
setting code flag appropriately (only elf *really* handles this correctly,
coff still needs to handle GAS flags to work fully from GAS mode).

* gas-parser.h (yasm_parser_gas): Remove code_section flag.
* gas-bison.y (gas_switch_section): Don't set.
(gas_parser_align): Use yasm_section_is_code() instead of code_section flag.
* gas-parser.c: Don't initialize code_section flag.

svn path=/trunk/yasm/; revision=1318
15 files changed:
libyasm/section.c
libyasm/section.h
modules/dbgfmts/stabs/stabs-dbgfmt.c
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/xdf/xdf-objfmt.c
modules/parsers/gas/gas-bison.y
modules/parsers/gas/gas-parser.c
modules/parsers/gas/gas-parser.h
modules/parsers/gas/tests/Makefile.inc
modules/parsers/gas/tests/execsect.asm [new file with mode: 0644]
modules/parsers/gas/tests/execsect.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/execsect.hex [new file with mode: 0644]