This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Possible Relocation Overflow ??
- To: kk@ddeorg.soft.net, Mark Mitchell <mark@codesourcery.com>
- Subject: Re: Possible Relocation Overflow ??
- From: Ian Lance Taylor <ian@zembu.com>
- Date: 13 Jul 1999 11:50:03 -0400
- CC: binutils@sourceware.cygnus.com
- References: <199907131455.UAA05703@madras.ddeorg.soft.net>
Date: Tue, 13 Jul 1999 20:25:03 +0530
From: "Koundinya.K" <kk@ddeorg.soft.net>
/usr/cygnus/H-mips-dde-sysv4.2MP/lib/crt1.o: In function `__start':
/usr/cygnus/H-mips-dde-sysv4.2MP/lib/crt1.o(.text+0x14): relocation
truncated to
fit: R_MIPS_LO16 _gp_disp
Mark, your code does overflow checking on R_MIPS_LO16 applied to
_gp_disp. That is what the ABI recommends, but I don't see how it can
possibly work. Code routinely uses R_MIPS_HI16 and R_MIPS_LO16 to
determine _gp_disp. It's OK if the R_MIPS_LO16 overflows, because the
R_MIPS_HI16 is there to take care of it.
/usr/cygnus/H-mips-dde-sysv4.2MP/lib/crti.o: In function `_init':
/usr/cygnus/H-mips-dde-sysv4.2MP/lib/crti.o(.init+0xc): undefined reference
to `_gp_disp'
Mark, if you look back at the original code, you will see that the
test for _gp_disp is done as the start of a series of if conditions.
Testing for an undefined symbol is only done if the symbol is not
_gp_disp. You need to replicate that, or you need to explicitly
define _gp_disp somewhere; the symbol _gp_disp is supposed to be
implicitly defined by the linker.
I think we need to go back to the original code and make sure that
every action it takes is reflected in the new code. I don't think
writing the new code from first principles is a good idea. There is
too much accumulated information which needs to be replicated.
Ian