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: Linker Testsuite


   From: Mark Mitchell <mark@codesourcery.com>
   Date: Thu, 15 Jul 1999 14:26:39 -0700

   Some tests (like cross.exp) seem to make rather unportable decisions
   about the linker.  For example, by using a custom linker script,
   cross1.t fools the linker into not creating a dynobj (as would
   normally be done with the ordinary linker script), but still compiler
   files that make use of GOT relocations, which then cause the linker to
   be confused since there is no GOT.  What's the right thing to do here?

I suspect that the basic problem is that for Irix compilation defaults
to PIC mode.

There is generally only a dynobj if one is needed.  On ELF targets
other than Irix, PIC is not the default.  Non-PIC code does not need a
dynobj, and does not need a GOT.

Actually, though, there is something odd going on.  Most targets will
set dynobj if they see a reloc which needs a GOT.  This is normally
done in the check_relocs routine; see the one in elf32-i386, for
example; search for R_386_GOT in that routine.  There is corresponding
code in the check_relocs routine in elf32-mips.c, so I'm surprised
that there is no dynobj when one is needed.  Am I misinterpreting what
you are saying?


Whatever comes of that, it's OK to setup_xfail cross.exp for Irix.
It's also OK to pass some option to disable PIC mode on Irix, if that
helps.  cross.exp is testing the NOCROSSREFS feature, which is only
useful on an embedded system, so we don't really care whether the test
passes on Irix.

Ian

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