]> granicus.if.org Git - yasm/commit
Preliminary GAS parser. Only a few instructions are supported at present.
authorPeter Johnson <peter@tortall.net>
Sun, 25 Sep 2005 04:25:26 +0000 (04:25 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 25 Sep 2005 04:25:26 +0000 (04:25 -0000)
commitaa2571e22ba3103549db8289716cb55f61c394c4
tree0701dfa123014dcaddd398b509f7adf21ea8ec75
parentcccdbc8060cfeaa620365c600ea0225c4e1a63b9
Preliminary GAS parser.  Only a few instructions are supported at present.
This work is being done under contract with a company that has requested
to remain unnamed at the present time.

* bc-int.h (yasm_effaddr): Add strong flag to indicate if the effective
address is definitely an effective address; GAS does not use [] to designate
effective addresses so it's otherwise impossible to tell the difference
between "expr(,1)" and just "expr" (important for the relative jump
instructions).
* bytecode.h (yasm_ea_set_strong): New function to set the strong flag.
* bytecode.c (yasm_ea_set_strong): Implementation.
* x86bc.c (yasm_x86__ea_create_reg): Initialize strong flag.

* arch.h (yasm_insn_operand): Add deref flag to indicate use of "*foo" in
GAS syntax.
* arch.c (yasm_operand_create_reg, yasm_operand_create_segreg)
(yasm_operand_create_mem, yasm_operand_create_imm): Set deref flag to 0.

* gas: GAS syntax lexer and parser.  Not all directives are implemented yet
(some will require additional core bytecodes).

* elf-objfmt.c (elf_objfmt_section_switch): Add support for GAS-style
section flags.

* x86arch.h (yasm_arch_x86): Add parser setting.
* x86arch.c (x86_create): Check for gas parser and initialize setting.

* x86bc.c (yasm_x86__ea_create_expr): Transform val+RIP to val wrt RIP when
using the GAS parser (this is how GAS interprets "expr(%rip)").

* x86id.re: Too many changes to enumerate in detail.  Add new modifiers for
GAS suffixes.  Start using them in a couple instructions.  Split check_id
into subfunctions (still one entry point at present).
(yasm_x86__finalize_insn): Support new modifiers, reverse operands, derefs.

* yasm.c (main): Change all undef to extern when using GAS parser (this is
default GAS behavior).

svn path=/trunk/yasm/; revision=1239
39 files changed:
frontends/yasm/yasm.c
libyasm/arch.c
libyasm/arch.h
libyasm/bc-int.h
libyasm/bytecode.c
libyasm/bytecode.h
modules/arch/x86/x86arch.c
modules/arch/x86/x86arch.h
modules/arch/x86/x86bc.c
modules/arch/x86/x86id.re
modules/objfmts/elf/elf-objfmt.c
modules/parsers/Makefile.inc
modules/parsers/gas/Makefile.inc [new file with mode: 0644]
modules/parsers/gas/gas-bison.y [new file with mode: 0644]
modules/parsers/gas/gas-defs.h [new file with mode: 0644]
modules/parsers/gas/gas-parser.c [new file with mode: 0644]
modules/parsers/gas/gas-parser.h [new file with mode: 0644]
modules/parsers/gas/gas-token.re [new file with mode: 0644]
modules/parsers/gas/tests/Makefile.inc [new file with mode: 0644]
modules/parsers/gas/tests/amd64/Makefile.inc [new file with mode: 0644]
modules/parsers/gas/tests/amd64/gas_amd64_test.sh [new file with mode: 0755]
modules/parsers/gas/tests/amd64/riprel.asm [new file with mode: 0644]
modules/parsers/gas/tests/amd64/riprel.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/amd64/riprel.hex [new file with mode: 0644]
modules/parsers/gas/tests/datavis.asm [new file with mode: 0644]
modules/parsers/gas/tests/datavis.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/datavis.hex [new file with mode: 0644]
modules/parsers/gas/tests/datavis2.asm [new file with mode: 0644]
modules/parsers/gas/tests/datavis2.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/datavis2.hex [new file with mode: 0644]
modules/parsers/gas/tests/gas_test.sh [new file with mode: 0755]
modules/parsers/gas/tests/jmpcall.asm [new file with mode: 0644]
modules/parsers/gas/tests/jmpcall.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/jmpcall.hex [new file with mode: 0644]
modules/parsers/gas/tests/reggroup-err.asm [new file with mode: 0644]
modules/parsers/gas/tests/reggroup-err.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/reggroup.asm [new file with mode: 0644]
modules/parsers/gas/tests/reggroup.errwarn [new file with mode: 0644]
modules/parsers/gas/tests/reggroup.hex [new file with mode: 0644]