# # Unusual variables checked by this code: # NOP - two byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # OTHER_READONLY_SECTIONS - other than .text .init .rodata ... # (e.g., .PARISC.milli) # OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... # (e.g., .PARISC.global) # OTHER_SECTIONS - at the end # EXECUTABLE_SYMBOLS - symbols that must be defined for an # executable (e.g., _DYNAMIC_LINK) # TEXT_START_SYMBOLS - symbols that appear at the start of the # .text section. # DATA_START_SYMBOLS - symbols that appear at the start of the # .data section. # OTHER_BSS_SYMBOLS - symbols that appear at the start of the # .bss section besides __bss_start. # DATA_PLT - .plt should be in data segment, not text segment. # EMBEDDED - whether this is for an embedded system. # # When adding sections, do note that the names of some sections are used # when specifying the start address of the next. # test -z "$ENTRY" && ENTRY=_start test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi test "$LD_FLAG" = "N" && DATA_ADDR=. INTERP=".interp ${RELOCATING-0} : { *(.interp) }" PLT=".plt ${RELOCATING-0} : { *(.plt) }" 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}} }" # if this is for an embedded system, don't add SIZEOF_HEADERS. if [ -z "$EMBEDDED" ]; then test -z "${READONLY_BASE_ADDRESS}" && READONLY_BASE_ADDRESS="${READONLY_START_ADDR} + SIZEOF_HEADERS" else test -z "${READONLY_BASE_ADDRESS}" && READONLY_BASE_ADDRESS="${READONLY_START_ADDR}" fi cat <