# Adapted from mips.sc # # Copyright (C) 2014-2020 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. # # These variables may be overridden by the emulation file. The # defaults are appropriate for a DECstation running Ultrix. test -z "$ENTRY" && ENTRY=_start #test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x0" CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} /* gcc uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it doesn't matter if the user does not actually link against crtbegin.o; the linker won't look for a file to match a wildcard. The wildcard also means that it doesn't matter which directory crtbegin.o is in. */ KEEP (*crtbegin.o(.ctors)) /* We don't want to include the .ctor section from from the crtend.o file until after the sorted ctors. The .ctor section from the crtend file contains the end of ctors marker and it must be last */ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) ${CONSTRUCTING+${CTOR_END}} }" DTOR=" .dtors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${DTOR_START}} KEEP (*crtbegin.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) ${CONSTRUCTING+${DTOR_END}} }" cat <