Don't let mips-elf provide __CTOR_LIST__ in libgcc

Jonathan Larmour jlarmour@redhat.co.uk
Wed Mar 1 06:07:00 GMT 2000


Ping :-).

Jifl

In article <388DB92A.62C4147@redhat.co.uk> you write:
>This is a multi-part message in MIME format.
>--------------5DBDA93B6AD2DB1521BCB4E9
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>The rationale behind this change is that either __CTOR_LIST__ should come
>from crtbegin.o or the user will provide it. There is no need to rely on
>libgcc to provide it.
>
>If left as-is, then it becomes impossible for people who define
>__CTOR_LIST__ in linker scripts rather than by magic .o files at the start
>of the link line to get the list right. The reason is that two null entries
>get placed somewhere in the middle of the __CTOR_LIST__ depending on where
>the first reference to __CTOR_LIST__ in the linked .o files came from.
>
>Ta,
>
>Jifl
>-- 
>Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS   Tel: +44 (1223) 728762
>"I used to have an open mind but || Get yer free open source RTOS's here...
> my brains kept falling out."    || http://sourceware.cygnus.com/ecos
>Help fight spam! http://spam.abuse.net/  These opinions are all my own fault
>--------------5DBDA93B6AD2DB1521BCB4E9
>Content-Type: text/plain; charset=us-ascii;
> name="mipselfctor.patch"
>Content-Transfer-Encoding: 7bit
>Content-Disposition: inline;
> filename="mipselfctor.patch"
>
>Tue Jan 25 14:41:45 2000  Jonathan Larmour  <jlarmour@cygnus.co.uk>
> 
>        * config/mips/elf.h (CTOR_LISTS_DEFINED_EXTERNALLY): Define because
>        __CTOR_LIST__ always comes from either crtbegin.o or equivalent, or
>        directly from the user if they chose to override it
>                                                                                             
>Index: config/mips/elf.h
>===================================================================
>RCS file: /cvs/cvsfiles/devo/gcc/config/mips/elf.h,v
>retrieving revision 1.24.16.3
>diff -u -5 -p -r1.24.16.3 elf.h
>--- elf.h	1999/12/07 14:04:59	1.24.16.3
>+++ elf.h	2000/01/25 14:50:06
>@@ -288,10 +288,15 @@ do {									   \
>    via the SHF_WRITE attribute.)  */
> 
> #define CTORS_SECTION_ASM_OP    "\t.section\t.ctors,\"aw\""
> #define DTORS_SECTION_ASM_OP    "\t.section\t.dtors,\"aw\""
>  
>+/* There's no point providing a default definition of __CTOR_LIST__
>+   since people are expected either to use crtbegin.o, or an equivalent,
>+   or provide their own definition.  */
>+#define CTOR_LISTS_DEFINED_EXTERNALLY
>+
> /* A list of other sections which the compiler might be "in" at any
>    given time.  */
> #undef EXTRA_SECTIONS
> #define EXTRA_SECTIONS in_sdata, in_sbss, in_rdata, in_ctors, in_dtors
>  
>@@ -375,13 +380,10 @@ void FN ()                              
> #ifdef IN_LIBGCC2
> /* We must also declare them 'extern' for libgcc.a, or they will
>    be referenced as if they were in .sdata.  */
> extern unsigned char __attribute__((section(".eh_frame"))) 
>      __EH_FRAME_BEGIN__[];
>-extern void (* __attribute__((section(".ctors"))) __CTOR_LIST__[])();
>-     
>-extern void (* __attribute__((section(".dtors"))) __DTOR_LIST__[])();
> #endif
> 
> /* Don't set the target flags, this is done by the linker script */
> #undef LIB_SPEC
> #define LIB_SPEC ""
>
>--------------5DBDA93B6AD2DB1521BCB4E9--
>


-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault


More information about the Gcc-patches mailing list