This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: assembler relaxation
- From: Nick Clifton <nickc at redhat dot com>
- To: "nagaraju.m" <nagaraju dot m at redpinesignals dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 28 Dec 2009 12:37:55 +0000
- Subject: Re: assembler relaxation
- References: <4B385E26.6000207@redpinesignals.com>
Hi Nagaraju,
I have ported Binutils to a new port. My problem is that in a 16-bit
instruction if the constant range is exceeded then I need to emit 2
instructions. I have referred other architectures and did it and my
assembler is generating instructions them. While running some bench mark
codes it is observed instead of generating two instructions it is
generating 1-st instruction correctly and for other instruction it is
appending Zero's as a result it got struck up.
Without access to the source code for your new port is hard to give
specific advice[1] but in general what you need to do is to look at the
where these instructions are generated/inserted and determine why the
second instruction is using zeroes.
Note - normally relaxation works the other way. That is it normally
removes instructions rather than adding them. Thus I would have
expected that the default behaviour be for the compiler (or user, if we
are talking about hand generated assembler source files) to generate the
two instruction sequence, and for the assembler to relax this to just
one instruction if it can show that this will work.
Cheers
Nick
[1] I am not asking for a copy of the source code - I would rather that
you debug the problem yourself, possibly with some help from this list.
Posting code fragments and more detailed examples of the problem is a
good idea though.