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: H8S Bug when using -relax for h8300-elf




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

mov.b @aa:8,Rd  --> 2<rd> <abs:8>
mov.b @aa:16,Rd --> 6a 0<rd> <abs:16>
mov.b @aa:32,Rd --> 6a 2<rd> <abs:32>

So the changes are
		  case 0x20:
! 		    bfd_put_8 (abfd, (code & 0xf) | 0x20,
  			       contents + irel->r_offset - 2);
! 		    break;

case 0xa0:
! 		    bfd_put_8 (abfd, (code & 0xf) | 0x30,
  			       contents + irel->r_offset - 2);
! 		    break;

0x00 and 0x80 only apply to 16 bit address formats.


BUT later on only two bytes are deleted when four bytes should be deleted
and what about irel->r_offset it has now moved back one location. Should
irel->r_offset be changed? Should it be changed before the delete bytes call or after?


Paul Clarke



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