xref: /netbsd-src/external/gpl3/binutils.old/dist/ld/scripttempl/aout.sc (revision e992f068c547fd6e84b3f104dc2340adcc955732)
1*e992f068Schristos# Copyright (C) 2014-2022 Free Software Foundation, Inc.
216dce513Schristos#
316dce513Schristos# Copying and distribution of this file, with or without modification,
416dce513Schristos# are permitted in any medium without royalty provided the copyright
516dce513Schristos# notice and this notice are preserved.
616dce513Schristos#
716dce513Schristostest -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
816dce513Schristostest -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
916dce513Schristostest -z "${ALIGNMENT}" && ALIGNMENT="4"
1016dce513Schristos
1116dce513Schristoscat <<EOF
12*e992f068Schristos/* Copyright (C) 2014-2022 Free Software Foundation, Inc.
1316dce513Schristos
1416dce513Schristos   Copying and distribution of this script, with or without modification,
1516dce513Schristos   are permitted in any medium without royalty provided the copyright
1616dce513Schristos   notice and this notice are preserved.  */
1716dce513Schristos
1816dce513SchristosOUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
1916dce513Schristos	      "${LITTLE_OUTPUT_FORMAT}")
2016dce513SchristosOUTPUT_ARCH(${ARCH})
2116dce513Schristos
2216dce513Schristos${RELOCATING+${LIB_SEARCH_DIRS}}
2316dce513Schristos${STACKZERO+${RELOCATING+${STACKZERO}}}
2416dce513Schristos${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
2516dce513Schristos${RELOCATING+${EXECUTABLE_SYMBOLS}}
2616dce513Schristos${RELOCATING+PROVIDE (__stack = 0);}
2716dce513SchristosSECTIONS
2816dce513Schristos{
2916dce513Schristos  ${RELOCATING+. = ${TEXT_START_ADDR};}
3016dce513Schristos  .text :
3116dce513Schristos  {
3216dce513Schristos    CREATE_OBJECT_SYMBOLS
3316dce513Schristos    *(.text)
3416dce513Schristos    /* The next six sections are for SunOS dynamic linking.  The order
3516dce513Schristos       is important.  */
3616dce513Schristos    *(.dynrel)
3716dce513Schristos    *(.hash)
3816dce513Schristos    *(.dynsym)
3916dce513Schristos    *(.dynstr)
4016dce513Schristos    *(.rules)
4116dce513Schristos    *(.need)
4216dce513Schristos    ${RELOCATING+_etext = .;}
4316dce513Schristos    ${RELOCATING+__etext = .;}
4416dce513Schristos    ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
4516dce513Schristos  }
4616dce513Schristos  ${RELOCATING+. = ${DATA_ALIGNMENT};}
4716dce513Schristos  .data :
4816dce513Schristos  {
4916dce513Schristos    /* The first three sections are for SunOS dynamic linking.  */
5016dce513Schristos    *(.dynamic)
5116dce513Schristos    *(.got)
5216dce513Schristos    *(.plt)
5316dce513Schristos    *(.data)
5416dce513Schristos    *(.linux-dynamic) /* For Linux dynamic linking.  */
5516dce513Schristos    ${CONSTRUCTING+CONSTRUCTORS}
5616dce513Schristos    ${RELOCATING+_edata  =  .;}
5716dce513Schristos    ${RELOCATING+__edata  =  .;}
5816dce513Schristos  }
5916dce513Schristos  .bss :
6016dce513Schristos  {
6116dce513Schristos   ${RELOCATING+ __bss_start = .};
6216dce513Schristos   *(.bss)
6316dce513Schristos   *(COMMON)
6416dce513Schristos   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
6516dce513Schristos   ${RELOCATING+_end = . };
6616dce513Schristos   ${RELOCATING+__end = . };
6716dce513Schristos  }
6816dce513Schristos}
6916dce513SchristosEOF
70