aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-05-05 13:38:00 +0100
committerNick Clifton <nickc@redhat.com>2015-05-05 13:38:00 +0100
commit837a17b36c9e297f4bf33727e25dfa9f38360c17 (patch)
tree5cf6ecb482076cf1e20e437b6ea94c00c87cb103 /ld/scripttempl
parentb76f99d702c3501ac320396ea06bc7f9237173c3 (diff)
downloadgdb-837a17b36c9e297f4bf33727e25dfa9f38360c17.zip
gdb-837a17b36c9e297f4bf33727e25dfa9f38360c17.tar.gz
gdb-837a17b36c9e297f4bf33727e25dfa9f38360c17.tar.bz2
Add support to the MSP430 linker for the automatic placement of code and data into either low or high memory regions.
gas * config/tc-msp430.c (MAX_OP_LEN): Increase to 4096. (msp430_make_init_symbols): New function. (msp430_section): Call it. (msp430_frob_section): Likewise. ld * emulparams/msp430elf.sh (TEMPLATE_NAME): Change to msp430. * scripttempl/msp430.sc (.text): Add .lower.text and .either.text. (.data): Add .lower.data and .either.data. (.bss): Add .lower.bss and .either.bss. (.rodata): Add .lower.rodata and .either.rodata. * emultempl/msp430.em: New file. Implements a new orphan placement algorithm that divides sections between lower and upper memory regions. * Makefile.am (emsp430elf.c): Depend upon msp430.em. *emsp430X.c): Likewise. * Makefine.in: Regenerate.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/elf32msp430.sc20
1 files changed, 19 insertions, 1 deletions
diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc
index 15d5630..65105e5 100644
--- a/ld/scripttempl/elf32msp430.sc
+++ b/ld/scripttempl/elf32msp430.sc
@@ -154,12 +154,17 @@ SECTIONS
${CONSTRUCTING+ __dtors_end = . ; }
${RELOCATING+. = ALIGN(2);}
+ *(.lower.text.* .lower.text)
+
+ ${RELOCATING+. = ALIGN(2);}
*(.text)
${RELOCATING+. = ALIGN(2);}
*(.text.*)
${RELOCATING+. = ALIGN(2);}
*(.text:*)
+ *(.either.text.* .either.text)
+
${RELOCATING+. = ALIGN(2);}
*(SORT_NONE(.fini9))
*(SORT_NONE(.fini8))
@@ -178,11 +183,15 @@ SECTIONS
.rodata :
{
+ ${RELOCATING+. = ALIGN(2);}
+ *(.lower.rodata.* .lower.rodata)
+
. = ALIGN(2);
*(.plt)
*(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)
*(.rodata1)
+ *(.either.rodata.*) *(.either.rodata)
*(.eh_frame_hdr)
KEEP (*(.eh_frame))
@@ -242,23 +251,32 @@ SECTIONS
*(.data.rel.ro.local) *(.data.rel.ro*)
*(.dynamic)
+ ${RELOCATING+. = ALIGN(2);}
+ *(.lower.data.* .lower.data)
+
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
KEEP (*(.gnu.linkonce.d.*personality*))
*(.data1)
+
+ *(.either.data.* .either.data)
+
*(.got.plt) *(.got)
${RELOCATING+. = ALIGN(2);}
*(.sdata .sdata.* .gnu.linkonce.s.*)
${RELOCATING+. = ALIGN(2);}
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > data ${RELOCATING+AT> text}}
-
+
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{
${RELOCATING+. = ALIGN(2);}
${RELOCATING+ PROVIDE (__bss_start = .) ; }
+ *(.lower.bss.* .lower.bss)
+ ${RELOCATING+. = ALIGN(2);}
*(.bss)
+ *(.either.bss.* .either.bss)
*(COMMON)
${RELOCATING+ PROVIDE (__bss_end = .) ; }
${RELOCATING+ _end = . ; }