This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] x86: adjust relocation overflow complaint types
On Mon, Aug 01, 2005 at 10:14:35AM -0700, H. J. Lu wrote:
> On Mon, Aug 01, 2005 at 02:12:03PM +0200, Andreas Schwab wrote:
> > Ian Lance Taylor <ian@airs.com> writes:
> >
> > > For what it's worth, I agree with Michael. R_386_PC16 reliably wraps
> > > around in 16-bit code.
> >
> > But then it shouldn't be represented internally as BFD_RELOC_16_PCREL,
> > since that has different semantics.
> >
>
> Those relocations aren't in the i386 psABI. They were added by
>
> Wed Aug 7 12:12:03 1996 Ian Lance Taylor <ian@cygnus.com>
>
> * cpu-i386.c (i8086_arch): Architecture info for the i8086.
>
> Based on patches from Eric Valette <valette@crf.canon.fr>:
> * elf32-i386.c (enum reloc_type): Add FIRST_INVALID_RELOC,
> LAST_INVALID_RELOC, R_386_16, R_386_PC16, R_386_8, R_386_PC8.
>
> It looks like they were intended for 16bit codes. But we were using
> them for 32bit codes. I don't know if it is a good idea since those
> object files won't be compatible with othe i386 linkers.
>
> I'd like to restricts those relocations to 16bit code. Jan, what do
> you think?
If we want to use R_xxx_16/R_xxx_8 in 32bit/64bit codes, we should use
differet numbers so that we can proper check overflows in 16bit code.
H.J