This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: H8S Bug when using -relax for h8300-elf
- From: Nick Clifton <nickc at redhat dot com>
- To: ShrinivasA at kpit dot com
- Cc: binutils at sources dot redhat dot com
- Date: 30 Apr 2003 12:52:34 +0100
- Subject: Re: H8S Bug when using -relax for h8300-elf
- References: <69595093233BB547BB70CF5E492B63F2011ACCE1@sohm.kpit.com>
Hi Shrinivas,
> Thank you for sending the patch.
>
> With this patch h8300-elf-ld does not core dump. Hence the ld
> crashing problem is solved.
Excellent.
> However, the objdump shows that still 24 bit absolute address is
> used. Whereas in this case usage of -relax switch should make it 8
> bit absolute address. Which it is not doing.
>
> Any clue ?
Yes - my patch just stops the linker from core dumping, it does not
implement relaxing for this form of addressing mode. That is because
I am completely unfamiliar with the H8300 instruction set, so I do not
know how the instruction should be relaxed.
If you would care to look over the code in elf32_h8_relax_section()
you may be able to work out what needs to be done. I assume that this
part of the patch:
> ! case 0x20:
> ! case 0xa0:
> ! /* Skip 32bit versions. */
> ! skip = TRUE;
> ! break;
needs to be changed to be similar to this part:
> ! case 0x00:
> ! bfd_put_8 (abfd, (code & 0xf) | 0x20,
> contents + irel->r_offset - 2);
> ! break;
> ! case 0x80:
> ! bfd_put_8 (abfd, (code & 0xf) | 0x30,
> contents + irel->r_offset - 2);
> ! break;
Cheers
Nick