This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: binutils development (was Re: Problems building binutils-000220snapshot)
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: binutils development (was Re: Problems building binutils-000220snapshot)
- From: Alan Modra <alan at SPRI dot Levels dot UniSA dot Edu dot Au>
- Date: Wed, 23 Feb 2000 16:25:52 +1030 (CST)
- cc: Doug Evans <dje at transmeta dot com>, binutils at sourceware dot cygnus dot com
On Tue, 22 Feb 2000, H . J . Lu wrote:
> On Wed, Feb 23, 2000 at 11:15:51AM +1030, Alan Modra wrote:
> > >
> > > Why is 64k? It is 16bit relocation. You should be able to go both
> > > directions.
> >
> > That's right, in 16-bit mode you should be able to jump from any point in
> > the 64K address space to any other point. The three little test files
>
>
> From what I see in the Intel ia32 instruction manual, it says
> rel16 is signed 16bit value and it is encoded in 2 byes. How can
> that be 64K in either direction?
Because the address space is only 64K (ignoring segments). It's true that
the offset is signed, and a jump from 0 to 0xe003 has a rel16 offset of
-0x2000. The bfd reloc code will complain in this case though as it sees
an offset of +0xe000, which is outside the signed 16 bit range.