This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Adding % directives for use with constant tables
- From: Nick Clifton <nickc at redhat dot com>
- To: "Nick Kelsey" <fsf at silicondust dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: Thu, 30 Oct 2003 11:34:41 +0000
- Subject: Re: Adding % directives for use with constant tables
- References: <019401c39e68$9b90eea0$0502a8c0@scenix.com>
Hi Nick,
> I would like to add %data() and %insn() directives that can be used in
> constant table (ip2k port) - eg:
>
> .word %insn(foo)
> .word %data(bar)
>
> The % directives I have added in the past have been added to the operand
> parse function on a per opcode basis... How would I go about adding this
> feature either generally or specifically for const tables?
If you only need this feature for .word directives (and similar ones,
ie .short, .long etc) then you can provide your own function to parse
them. For example look at gas/config/tc-arm.c where it traps them in
the md_pseudo_table[] and then handles them in s_arm_elf_cons().
Cheers
Nick