1995-08-17 22:53:56 +00:00
|
|
|
# Linker script for PE.
|
1997-06-07 03:48:00 +00:00
|
|
|
|
1995-05-12 18:55:06 +00:00
|
|
|
cat <<EOF
|
1995-08-17 22:53:56 +00:00
|
|
|
OUTPUT_FORMAT(${OUTPUT_FORMAT})
|
1995-05-12 18:55:06 +00:00
|
|
|
${LIB_SEARCH_DIRS}
|
|
|
|
|
|
|
|
ENTRY(_mainCRTStartup)
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
1995-11-25 02:37:58 +00:00
|
|
|
.text ${RELOCATING+ __image_base__ + __section_alignment__ } :
|
1997-06-07 03:48:00 +00:00
|
|
|
{
|
|
|
|
${RELOCATING+ *(.init)}
|
|
|
|
*(.text)
|
|
|
|
${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
|
|
|
|
LONG (-1); *(.ctors); *(.ctor); LONG (0); }
|
|
|
|
${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
|
|
|
|
LONG (-1); *(.dtors); *(.dtor); LONG (0); }
|
|
|
|
${RELOCATING+ *(.fini)}
|
|
|
|
/* ??? Why is .gcc_exc here? */
|
|
|
|
${RELOCATING+ *(.gcc_exc)}
|
|
|
|
${RELOCATING+ etext = .;}
|
|
|
|
/* Grouped section support currently must be explicitly provided for
|
|
|
|
in the linker script. */
|
|
|
|
*(.text\$)
|
|
|
|
*(.gcc_except_table)
|
|
|
|
}
|
1995-05-12 18:55:06 +00:00
|
|
|
|
1995-11-25 02:37:58 +00:00
|
|
|
.bss BLOCK(__section_alignment__) :
|
1997-06-07 03:48:00 +00:00
|
|
|
{
|
|
|
|
__bss_start__ = . ;
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
__bss_end__ = . ;
|
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
.data BLOCK(__section_alignment__) :
|
1997-06-07 03:48:00 +00:00
|
|
|
{
|
|
|
|
__data_start__ = . ;
|
|
|
|
*(.data)
|
|
|
|
*(.data2)
|
|
|
|
__data_end__ = . ;
|
|
|
|
/* Grouped section support currently must be explicitly provided for
|
|
|
|
in the linker script. */
|
|
|
|
*(.data\$)
|
|
|
|
}
|
1995-05-12 18:55:06 +00:00
|
|
|
|
1995-11-25 02:37:58 +00:00
|
|
|
.rdata BLOCK(__section_alignment__) :
|
1997-06-07 03:48:00 +00:00
|
|
|
{
|
1995-05-12 18:55:06 +00:00
|
|
|
*(.rdata)
|
1997-06-07 03:48:00 +00:00
|
|
|
/* Grouped section support currently must be explicitly provided for
|
|
|
|
in the linker script. */
|
|
|
|
*(.rdata\$)
|
1995-05-12 18:55:06 +00:00
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
|
1997-06-07 03:48:00 +00:00
|
|
|
.edata BLOCK(__section_alignment__) :
|
|
|
|
{
|
|
|
|
*(.edata)
|
1995-11-25 02:37:58 +00:00
|
|
|
}
|
|
|
|
|
1997-06-07 03:48:00 +00:00
|
|
|
/DISCARD/ BLOCK(__section_alignment__) :
|
|
|
|
{
|
1995-11-25 02:37:58 +00:00
|
|
|
*(.debug\$S)
|
|
|
|
*(.debug\$T)
|
|
|
|
*(.debug\$F)
|
|
|
|
*(.drectve)
|
1995-05-12 18:55:06 +00:00
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
|
|
|
|
.idata BLOCK(__section_alignment__) :
|
1997-06-07 03:48:00 +00:00
|
|
|
{
|
|
|
|
/* This cannot currently be handled with grouped sections.
|
|
|
|
See pe.em:sort_sections. */
|
1995-06-29 00:21:00 +00:00
|
|
|
*(.idata\$2)
|
|
|
|
*(.idata\$3)
|
1997-06-07 03:48:00 +00:00
|
|
|
${RELOCATING+ /* These zeroes mark the end of the import list. */}
|
|
|
|
${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);}
|
1995-06-29 00:21:00 +00:00
|
|
|
*(.idata\$4)
|
|
|
|
*(.idata\$5)
|
|
|
|
*(.idata\$6)
|
|
|
|
*(.idata\$7)
|
1995-05-12 18:55:06 +00:00
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
.CRT BLOCK(__section_alignment__) :
|
1995-05-12 18:55:06 +00:00
|
|
|
{
|
1997-06-07 03:48:00 +00:00
|
|
|
/* Grouped sections are used to handle .CRT\$foo. */
|
|
|
|
*(.CRT\$)
|
1995-05-12 18:55:06 +00:00
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
.rsrc BLOCK(__section_alignment__) :
|
1995-05-12 18:55:06 +00:00
|
|
|
{
|
1997-06-07 03:48:00 +00:00
|
|
|
/* Grouped sections are used to handle .rsrc\$0[12]. */
|
|
|
|
*(.rsrc\$)
|
1995-05-12 18:55:06 +00:00
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
|
|
|
|
.endjunk BLOCK(__section_alignment__) :
|
|
|
|
{
|
1996-04-30 03:33:23 +00:00
|
|
|
/* end is deprecated, don't use it */
|
1997-06-07 03:48:00 +00:00
|
|
|
${RELOCATING+ end = .;}
|
|
|
|
${RELOCATING+ __end__ = .;}
|
1995-05-12 18:55:06 +00:00
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
|
|
|
|
.stab BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
|
1995-05-12 18:55:06 +00:00
|
|
|
{
|
|
|
|
[ .stab ]
|
|
|
|
}
|
|
|
|
|
1995-11-25 02:37:58 +00:00
|
|
|
.stabstr BLOCK(__section_alignment__) ${RELOCATING+(NOLOAD)} :
|
1995-05-12 18:55:06 +00:00
|
|
|
{
|
|
|
|
[ .stabstr ]
|
|
|
|
}
|
1995-11-25 02:37:58 +00:00
|
|
|
|
|
|
|
.reloc BLOCK(__section_alignment__) :
|
|
|
|
{
|
|
|
|
*(.reloc)
|
|
|
|
}
|
1995-05-12 18:55:06 +00:00
|
|
|
}
|
|
|
|
EOF
|