]> granicus.if.org Git - yasm/commit
Enhance builtin bytecode_data to support embedded NULs in character strings.
authorPeter Johnson <peter@tortall.net>
Wed, 26 Oct 2005 03:22:44 +0000 (03:22 -0000)
committerPeter Johnson <peter@tortall.net>
Wed, 26 Oct 2005 03:22:44 +0000 (03:22 -0000)
commit1abcdbfc01c37010367ee15f278f8252ef9fb764
treed17e19eaa3cc5b828ed87d1e1efe637fff85d755
parent4024e3b87e606030efce9acf61b55a47a45f2239
Enhance builtin bytecode_data to support embedded NULs in character strings.
While NASM doesn't allow this, GAS does.

While we're here, greatly clean up GAS data bytecode creation by no longer
building intermediate valparam list.

* bytecode.h (yasm_dv_create_string): Add length parameter.
(yasm_bc_create_data): Add append_zero parameter for new ability to append
a single ero byte after each data value.  This is used by the GAS .asciz
directive.
* bytecode.c (bytecode_data, ...): Implement the above.

* gas-bison.y (gas_define_strings, gas_define_data)
(gas_define_leb128): Remove; replace in usage with direct calls to bytecode
functions.  Add str, dataval, and datavalhead to parser union.  Add new
dirvals, which has valparams type, and change strvals and datavals to
datavals type.
* gas-token.re: Use new str type where STRING token is generated.

* nasm-bison.y: Add str type to union, and use for STRING token.
* nasm-token.re: Use new str type where STRING token is generated.

* coff-objfmt.c (win32_objfmt_directive): Adjust for updates to
bytecode_data.

* strzero.asm: Simple test for NUL in GAS string.

svn path=/trunk/yasm/; revision=1293
libyasm/bytecode.c
libyasm/bytecode.h
modules/objfmts/coff/coff-objfmt.c
modules/parsers/gas/gas-bison.y
modules/parsers/gas/gas-token.re
modules/parsers/gas/tests/Makefile.inc
modules/parsers/gas/tests/strzero.asm [new file with mode: 0644]
modules/parsers/gas/tests/strzero.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/strzero.hex [new file with mode: 0644]
modules/parsers/nasm/nasm-bison.y
modules/parsers/nasm/nasm-token.re