xref: /openbsd-src/gnu/usr.bin/binutils-2.17/ld/scripttempl/aout.sc (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiodtest -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
2*3d8817e4Smiodtest -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
3*3d8817e4Smiodtest -z "${ALIGNMENT}" && ALIGNMENT="4"
4*3d8817e4Smiod
5*3d8817e4Smiodcat <<EOF
6*3d8817e4SmiodOUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
7*3d8817e4Smiod	      "${LITTLE_OUTPUT_FORMAT}")
8*3d8817e4SmiodOUTPUT_ARCH(${ARCH})
9*3d8817e4Smiod
10*3d8817e4Smiod${RELOCATING+${LIB_SEARCH_DIRS}}
11*3d8817e4Smiod${STACKZERO+${RELOCATING+${STACKZERO}}}
12*3d8817e4Smiod${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
13*3d8817e4Smiod${RELOCATING+${EXECUTABLE_SYMBOLS}}
14*3d8817e4Smiod${RELOCATING+PROVIDE (__stack = 0);}
15*3d8817e4SmiodSECTIONS
16*3d8817e4Smiod{
17*3d8817e4Smiod  ${RELOCATING+. = ${TEXT_START_ADDR};}
18*3d8817e4Smiod  .text :
19*3d8817e4Smiod  {
20*3d8817e4Smiod    CREATE_OBJECT_SYMBOLS
21*3d8817e4Smiod    *(.text)
22*3d8817e4Smiod    /* The next six sections are for SunOS dynamic linking.  The order
23*3d8817e4Smiod       is important.  */
24*3d8817e4Smiod    *(.dynrel)
25*3d8817e4Smiod    *(.hash)
26*3d8817e4Smiod    *(.dynsym)
27*3d8817e4Smiod    *(.dynstr)
28*3d8817e4Smiod    *(.rules)
29*3d8817e4Smiod    *(.need)
30*3d8817e4Smiod    ${RELOCATING+_etext = .;}
31*3d8817e4Smiod    ${RELOCATING+__etext = .;}
32*3d8817e4Smiod    ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
33*3d8817e4Smiod  }
34*3d8817e4Smiod  ${RELOCATING+. = ${DATA_ALIGNMENT};}
35*3d8817e4Smiod  .data :
36*3d8817e4Smiod  {
37*3d8817e4Smiod    /* The first three sections are for SunOS dynamic linking.  */
38*3d8817e4Smiod    *(.dynamic)
39*3d8817e4Smiod    *(.got)
40*3d8817e4Smiod    *(.plt)
41*3d8817e4Smiod    *(.data)
42*3d8817e4Smiod    *(.linux-dynamic) /* For Linux dynamic linking.  */
43*3d8817e4Smiod    ${CONSTRUCTING+CONSTRUCTORS}
44*3d8817e4Smiod    ${RELOCATING+_edata  =  .;}
45*3d8817e4Smiod    ${RELOCATING+__edata  =  .;}
46*3d8817e4Smiod  }
47*3d8817e4Smiod  .bss :
48*3d8817e4Smiod  {
49*3d8817e4Smiod   ${RELOCATING+ __bss_start = .};
50*3d8817e4Smiod   *(.bss)
51*3d8817e4Smiod   *(COMMON)
52*3d8817e4Smiod   ${RELOCATING+. = ALIGN(${ALIGNMENT});}
53*3d8817e4Smiod   ${RELOCATING+_end = . };
54*3d8817e4Smiod   ${RELOCATING+__end = . };
55*3d8817e4Smiod  }
56*3d8817e4Smiod}
57*3d8817e4SmiodEOF
58