binutils-gdb/ld/scripttempl/armcoff.sc

110 lines
2.7 KiB
Python
Raw Normal View History

1999-05-03 15:29:11 +08:00
# Linker script for ARM COFF.
# Based on i386coff.sc by Ian Taylor <ian@cygnus.com>.
test -z "$ENTRY" && ENTRY=_start
if test -z "${DATA_ADDR}"; then
if test "$LD_FLAG" = "N" || test "$LD_FLAG" = "n"; then
DATA_ADDR=.
fi
fi
2001-10-20 17:56:29 +08:00
# These are substituted in as variables in order to get '}' in a shell
# conditional expansion.
CTOR='.ctor : {
*(SORT(.ctors.*))
*(.ctor)
}'
DTOR='.dtor : {
*(SORT(.dtors.*))
*(.dtor)
}'
if test "${RELOCATING}"; then
R_IDATA234='
SORT(*)(.idata$2)
SORT(*)(.idata$3)
/* These zeroes mark the end of the import list. */
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
SORT(*)(.idata$4)'
R_IDATA5='SORT(*)(.idata$5)'
R_IDATA67='
SORT(*)(.idata$6)
SORT(*)(.idata$7)'
else
R_IDATA234=
R_IDATA5=
R_IDATA67=
fi
1999-05-03 15:29:11 +08:00
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", "${LITTLE_OUTPUT_FORMAT}")
1999-05-03 15:29:11 +08:00
${LIB_SEARCH_DIRS}
2009-09-09 19:59:14 +08:00
${RELOCATING+ENTRY (${ENTRY})}
1999-05-03 15:29:11 +08:00
SECTIONS
{
/* We start at 0x8000 because gdb assumes it (see FRAME_CHAIN).
This is an artifact of the ARM Demon monitor using the bottom 32k
as workspace (shared with the FP instruction emulator if
present): */
.text ${RELOCATING+ 0x8000} : {
*(.init)
2001-04-28 01:12:18 +08:00
*(.text*)
1999-05-03 15:29:11 +08:00
*(.glue_7t)
*(.glue_7)
*(.rdata)
${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1); *(.ctors); *(.ctor); LONG (0); }
${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
LONG (-1); *(.dtors); *(.dtor); LONG (0); }
*(.fini)
${RELOCATING+ etext = .;}
2001-04-28 01:12:18 +08:00
${RELOCATING+ _etext = .;}
1999-05-03 15:29:11 +08:00
}
2003-03-26 04:56:01 +08:00
.data ${RELOCATING+${DATA_ADDR-0x40000 + (ALIGN(0x8) & 0xfffc0fff)}} : {
1999-05-03 15:29:11 +08:00
${RELOCATING+ __data_start__ = . ;}
2001-04-28 01:12:18 +08:00
*(.data*)
2001-10-20 17:56:29 +08:00
${RELOCATING+*(.gcc_exc*)}
${RELOCATING+___EH_FRAME_BEGIN__ = . ;}
${RELOCATING+*(.eh_fram*)}
${RELOCATING+___EH_FRAME_END__ = . ;}
${RELOCATING+LONG(0);}
1999-05-03 15:29:11 +08:00
${RELOCATING+ __data_end__ = . ;}
${RELOCATING+ edata = .;}
${RELOCATING+ _edata = .;}
}
2001-10-20 17:56:29 +08:00
${CONSTRUCTING+${RELOCATING-$CTOR}}
${CONSTRUCTING+${RELOCATING-$DTOR}}
.idata ${RELOCATING+BLOCK(__section_alignment__)} :
{
/* This cannot currently be handled with grouped sections.
See pep.em:sort_sections. */
${R_IDATA234}
${RELOCATING+__IAT_start__ = .;}
${R_IDATA5}
${RELOCATING+__IAT_end__ = .;}
${R_IDATA67}
}
2003-03-26 04:56:01 +08:00
.bss ${RELOCATING+ ALIGN(0x8)} :
1999-05-03 15:29:11 +08:00
{
${RELOCATING+ __bss_start__ = . ;}
*(.bss)
*(COMMON)
${RELOCATING+ __bss_end__ = . ;}
}
${RELOCATING+ end = .;}
${RELOCATING+ _end = .;}
${RELOCATING+ __end__ = .;}
.stab 0 ${RELOCATING+(NOLOAD)} :
{
[ .stab ]
}
.stabstr 0 ${RELOCATING+(NOLOAD)} :
{
[ .stabstr ]
}
}
EOF