[Patch] (z80): def24 for three byte constants and more

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Patch] (z80): def24 for three byte constants and more

Bugzilla from arnold.metselaar@planet.nl
I am committing the following patch for the z80 target.
It adds a def24 and a def32 pseudo-op for 24 and 32 bit constants.
The way pseudo-ops for constants are handled is cleaned up a bit to make the assembler more consistent.

        * internal.h: Add relocation number R_IMM24 for Z80.

        * coff-z80.c (r_imm24): New howto.
        (rtype2howto): New case R_IMM24.
        (coff_z80_reloc_type_lookup): New case BFD_RELOC_24.
        (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24.

        * config/tc-z80.c (z80_start_line_hook): allow .equ and .defl as
        synonyms for equ and defl.
        (z80_cons_fix_new): New function.
        (emit_byte): Disallow relative jumps to absolute locations.
        (emit_data): Only handle defb, prototype changed, because defb is
        now handled as pseudo-op rather than an instruction.
        (instab): Entries for defb,defw,db,dw moved from here...
        (md_pseudo_table): ... to here, use generic cons() for defw,dw.
        Add entries for def24,def32,d24,d32.
        (md_assemble): Improved error handling.
        (md_apply_fix): New case BFD_RELOC_24, set fixP->fx_no_overflow to one.
        * config/tc-z80.h (TC_CONS_FIX_NEW): Define.
        (z80_cons_fix_new): Declare.
        * doc/c-z80.texi (defb, db): Mention warning on overflow.
        (def24,d24,def32,d32): New pseudo-ops.

def24.patch (13K) Download Attachment