From mboxrd@z Thu Jan 1 00:00:00 1970 From: joel@OARcorp.com To: Catherine Moore Cc: mrs@wrs.com, robertl@dgii.com, wilson@cygnus.com, egcs@cygnus.com, egcs-patches@cygnus.com Subject: Re: mips static constructor changes Date: Fri, 16 Apr 1999 09:05:00 -0000 Message-id: References: <199904131639.JAA29815@cygint.cygnus.com> X-SW-Source: 1999-04/msg00570.html Finally, I can reply to the original message. :) As noted in previous messages, binutils 2.9.1 does not appear to like KEEP and SORT. It also does not like the line to start with "(". So I ended up with this for the .ctors section: .ctors : { ___ctors = .; /* * This version is preferable but requires a very late * model binutils (post 2.9.1). KEEP(*crtbegin.o(.ctors)); KEEP(*(SORT(.ctors.*))); KEEP(*(.ctors)); */ *crtbegin.o(.ctors); *(.ctors.*); *(.ctors); ___ctors_end = .; } This works with mips64orion-rtems and binutils 2.9.1. My questions are: 1. Is this right? I know binutils is happy. :) 2. Where should crtend.o be mentioned? I think I am getting close here. :) --joel On Tue, 13 Apr 1999, Catherine Moore wrote: > > Index: idt.ld > =================================================================== > RCS file: /cvs/cvsfiles/devo/libgloss/mips/idt.ld,v > retrieving revision 1.8 > diff -p -r1.8 idt.ld > *** idt.ld 1997/09/08 18:46:20 1.8 > --- idt.ld 1999/02/04 19:02:22 > *************** SECTIONS > *** 44,49 **** > --- 44,65 ---- > etext = .; > _etext = .; > } > + .ctors : > + { > + ___ctors = .; > + KEEP(*crtbegin.o(.ctors)) > + KEEP(*(SORT(.ctors.*))) > + KEEP(*(.ctors)) > + ___ctors_end = .; > + } > + .dtors : > + { > + ___dtors = .; > + KEEP(*crtbegin.o(.dtors)) > + KEEP(*(SORT(.dtors.*))) > + KEEP(*(.dtors)) > + ___dtors_end = .; > + } > . = .; > .rdata : { > *(.rdata) > *************** SECTIONS > *** 51,57 **** > _fdata = ALIGN(16); > .data : { > *(.data) > - CONSTRUCTORS > } > . = ALIGN(8); > _gp = . + 0x8000; > --- 67,72 ---- > From mboxrd@z Thu Jan 1 00:00:00 1970 From: joel@OARcorp.com To: Catherine Moore Cc: mrs@wrs.com, robertl@dgii.com, wilson@cygnus.com, egcs@cygnus.com, egcs-patches@cygnus.com Subject: Re: mips static constructor changes Date: Fri, 30 Apr 1999 23:15:00 -0000 Message-ID: References: <199904131639.JAA29815@cygint.cygnus.com> X-SW-Source: 1999-04n/msg00574.html Message-ID: <19990430231500.gArAb6gEQ1WZDifAQ0sWuFLSrmP8kIaDSixjiUNBad0@z> Finally, I can reply to the original message. :) As noted in previous messages, binutils 2.9.1 does not appear to like KEEP and SORT. It also does not like the line to start with "(". So I ended up with this for the .ctors section: .ctors : { ___ctors = .; /* * This version is preferable but requires a very late * model binutils (post 2.9.1). KEEP(*crtbegin.o(.ctors)); KEEP(*(SORT(.ctors.*))); KEEP(*(.ctors)); */ *crtbegin.o(.ctors); *(.ctors.*); *(.ctors); ___ctors_end = .; } This works with mips64orion-rtems and binutils 2.9.1. My questions are: 1. Is this right? I know binutils is happy. :) 2. Where should crtend.o be mentioned? I think I am getting close here. :) --joel On Tue, 13 Apr 1999, Catherine Moore wrote: > > Index: idt.ld > =================================================================== > RCS file: /cvs/cvsfiles/devo/libgloss/mips/idt.ld,v > retrieving revision 1.8 > diff -p -r1.8 idt.ld > *** idt.ld 1997/09/08 18:46:20 1.8 > --- idt.ld 1999/02/04 19:02:22 > *************** SECTIONS > *** 44,49 **** > --- 44,65 ---- > etext = .; > _etext = .; > } > + .ctors : > + { > + ___ctors = .; > + KEEP(*crtbegin.o(.ctors)) > + KEEP(*(SORT(.ctors.*))) > + KEEP(*(.ctors)) > + ___ctors_end = .; > + } > + .dtors : > + { > + ___dtors = .; > + KEEP(*crtbegin.o(.dtors)) > + KEEP(*(SORT(.dtors.*))) > + KEEP(*(.dtors)) > + ___dtors_end = .; > + } > . = .; > .rdata : { > *(.rdata) > *************** SECTIONS > *** 51,57 **** > _fdata = ALIGN(16); > .data : { > *(.data) > - CONSTRUCTORS > } > . = ALIGN(8); > _gp = . + 0x8000; > --- 67,72 ---- >