This is the mail archive of the binutils@sourceware.cygnus.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]

Re: arm-elf-as truncates branch offsets w/o warning


On Thu, Mar 16, 2000 at 05:27:05PM -0800, Nick Clifton wrote:
> Hi Grant,
> 
> : It looks OK to me -- when I assemble the above and link it with
> : .text @ 0, I get:
> 
> Dag nab it - you are right.
> 
> Please ignore me.  I will go back to looking at your patch.

The problem is that the assembler saves the destination value
either relative to the current section or absolute in a 24-bit
field in the instruction itself.  If it doesn't fit, it used to
just throw away bits.  When the linker gets around to fixing up
the value so that it's PC-relative, it doesn't know that bits
are missing, so we end up with a bad value.

My patch generates an error when those bits are thrown away.

I'm still checking to see if there are any errors when no bits
are thrown away by the assembler.

-- 
Grant Edwards
grante@visi.com

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