Possible Relocation Overflow ??
Ian Lance Taylor
ian@zembu.com
Tue Jul 13 08:58:00 GMT 1999
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
More information about the Binutils
mailing list