This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Regarding Bitwise relaxation for H8/300
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Anil Paranjape <AnilP1 at KPITCummins dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 9 Dec 2003 21:48:45 +1030
- Subject: Re: Regarding Bitwise relaxation for H8/300
- References: <69595093233BB547BB70CF5E492B63F20324E6C7@sohm.kpit.com>
On Tue, Dec 09, 2003 at 02:24:53PM +0530, Anil Paranjape wrote:
> I would like to add relaxation support for bitwise insn like bset, bclr etc .
> Can anyone guide me on this ?
I suggest you first understand how the existing relaxation works. See
bfd/elf32-h8300.c:elf32_h8_relax_section. Linker relaxation needs the
assembler assembler to emit particular relocations that mark a relaxable
instruction sequence. In the case of "mov.b r2l,@0x120:32" you have an
R_H8_DIR32A16 relocation, which you can see comes from a
BFD_RELOC_H8_DIR32A16 (h8_reloc_map). Now if you look at
gas/config/tc-h8300.h you'll see that these are R_MOVL1 in
gas/config/tc-h8300.c. The thing to do would be to arrange for the
assembler to emit a similar reloc (or even the same one, I don't know
enough about the H8 architecture to say) for a bset instruction, and add
code to relax them in elf32-h8300.c.
--
Alan Modra
IBM OzLabs - Linux Technology Centre