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]
Other format: [Raw text]

RFA: elf.sc patch (was Re: RFA: MIPS's _gp symbol and the neworphan-placement code)


I'm a dunce.  I started this thread in November, when some changes
to the orphan code had the inadvertent (but totally understandable)
side-effect of breaking IRIX:

    http://sources.redhat.com/ml/binutils/2004-11/msg00116.html

My suggested fix was to change the way _gp is set, but although it
seemed to work, and was approved, I was too afraid to apply it for
fear of breaking some obscure target.

Alan's first suggestion was to use ". = ." as a placement hint instead:

    http://sources.redhat.com/ml/binutils/2004-11/msg00122.html

The thread continued with ideas for a more elaborate hint syntax, and
because of that, I'd somehow got the idea that we were talking about
adding a new feature here.  I didn't really like the ". = ." idiom
and put the whole thing on hold.

What I hadn't realised was that ". = ." was _already_ a supported
placement hint (and that that was why Alan was suggesting it).  Doh...

Given that ". = ." is the official syntax, and given that the whole
point of OTHER_GOT_SYMBOLS is to define symbols related to GOT_SECTIONS,
I agree that adding it to the script makes sense.  The patch below does
that and fixes the IRIX problem without any change to OTHER_GOT_SYMBOLS.

Tested on mips-sgi-irix6.5.  OK to install?

Richard


	* scripttempl/elf.sc: Insert ". = .;" before OTHER_GOT_SYMBOLS.

Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.50
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.50 elf.sc
*** ld/scripttempl/elf.sc	26 Oct 2004 18:41:52 -0000	1.50
--- ld/scripttempl/elf.sc	20 Jan 2005 22:07:48 -0000
*************** cat <<EOF
*** 380,385 ****
--- 380,386 ----
    ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
    ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
    ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
+   ${RELOCATING+${OTHER_GOT_SYMBOLS+. = .;}}
    ${RELOCATING+${OTHER_GOT_SYMBOLS}}
    ${NO_SMALL_DATA-${GOT}}
    ${OTHER_GOT_SECTIONS}


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