This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regarding Bitwise relaxation for H8/300


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]