5 /* The GNU
and SGI linkers differ
in their implementation of
-init
and -fini.
6 With the GNU linker
, there can only be a single
-init option
, and the
7 linker simply
sets DT_INIT to that value. gcc
's initialization and
8 finalization code can go directly in .init, with the prologue and
9 epilogue of the main initialization routine being provided by external
10 object files (*crti.o and *crtn.o in this case).
12 The SGI linker instead accepts several -init options. It will set DT_INIT
13 to a linker-created function (placed in .init) that calls each of the -init
14 functions in turn. If there is any user code in .init, this linker-created
15 function will be placed after it. Note that such user code is not treated
16 specially; it will only be called if the -init options arrange for it to
19 In theory, the SGI model should allow the crti, crtn and intermediate code
20 to go in .init, just like it can with the GNU linker. However, doing this
21 seems to confuse the linker and triggers an internal error:
23 ld32: FATAL 2 : Internal: at ../../ld/mips_code.c mips_code_fixup()
24 text section overflow!
26 (seen with MIPSpro 7.30). We therefore put everything in a special
27 .gcc_init section instead. */
29 .section .gcc_init,"ax",@progbits
32 #if _MIPS_SIM == _ABIO32
41 .section .gcc_fini,"ax",@progbits
44 #if _MIPS_SIM == _ABIO32