This is the mail archive of the binutils@sources.redhat.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: [hjl@valinux.com: Re: An ELF/PPC patch for ld/testsuite]


   Date: Thu, 19 Oct 2000 12:43:12 -0700
   From: Geoff Keating <geoffk@cygnus.com>

   - by creating a non-PIC shared object without a load offset, which
     causes it to be loaded just under the application at
     0x0FFFsomething, and having it branch to an undefined weak symbol
     which means location 0.  non-PIC code using undefined weak symbols
     is not supported on powerpc because it can't work.

This could be fixed by having the linker permit a relocation to an
undefined weak symbol even if that relocation appears to be out of
range.  The presumption is that the application will not actually call
such a symbol.

   The other restriction is a generic ELF one, which is that non-PIC
   applications cannot reliably reference undefined weak symbols.  The
   symbols will sometimes appear to be zero and sometimes not.

I don't understand this.  An undefined weak symbol should always
appear to be zero.  In what circumstance would that not be true?  I
think I can write a non-PIC application which uses undefined weak
symbols.
    if (&foo) foo();

Ian

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