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: R_MIPS_PC16 relocation handling, a proposal


   Date: Thu, 14 Oct 1999 17:43:36 +0200 (MET DST)
   From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>

   On 13 Oct 1999, Ian Lance Taylor wrote:

   > The ABI defines R_MIPS_PC16.  Our implementation should match the ABI.
   > We can't argue that the ABI got it wrong and implement it differently;
   > we will fail to interoperate with other implementations.

    We may define a GNU extension, i.e. a different relocation for this
   purpose -- it does not cost much.  One might say, using R_386_PC16 and
   R_386_PC8 do not make sense on a Unix system, yet they exist and thus make
   life simpler.  Note gcc do not generate any of these, so they are
   definitely a result of a work of an assembly language programmer who
   usually knows what are the limitations of the relevant opcodes and who
   will not be surprised to see an overflow error if it's for a reason.

I have no objection to adding a new relocation to handle branches.  In
fact, I think that is a good idea.  I was objecting to changing the
meaning of the existing R_MIPS_PC16 relocation.

    I am writing of a static relocation only, of course, that would be
   resolved when creating an executable or a shared object.  It makes no
   sense for dynamic linking, obviously.  But note that R_MIPS_26 is unsafe,
   too, as one cannot guarantee the jump will not need to cross the 256 MB
   boundary, yet the authors of the ABI did not hesitate to include it.

R_MIPS_26 can reasonably be considered to be different, as almost all
programs will fit in the 28 bit range, but many will not fit in the 18
bit range.  A compiler can reasonably generate R_MIPS_26 to another
object file, but it can not reasonably generate a branch to another
object file.

    And while writing of stupid errors -- the "A < 2" statement in the
   description of R_MIPS_26 certainly does not make any sense at all, does
   it?

I don't have my copy of the MIPS ELF ABI here, but I don't remember
seeing that error.  I have the printed Prentice Hall book, which was
printed long before SCO took over System V.

Ian

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