Adds support for placing MSP430 code and data into either low memory or high memory.

* msp430/msp430.ld: Delete.
	* msp430/msp430F5438A-l.ld: Delete.
	* msp430/msp430F5438A-s.ld: Delete.
	* msp430/crt_movedata.S: Delete.

	* msp430/Makefile.in (SCRIPTS): Remove msp430.ld.
	(CRT_OBJS): Add crt_move_highdata.o.
	* msp430/memmodel.h (START_CRT_FUNC): New macro.
	(END_CRT_FUNC): New macro.
	(WEAK_DEF): New macro.
	* msp430/crt0.S: Use new macros.
	(move_highdata): New code to initialise the .data section if it is
	held in high memory.

	* msp430/msp430-sim.ld (.data): Add .either.data.
	(.rodata2): Move some read-only data sections here.
	(.text): Add .either.text.
	(.rodata): Add .either.rodata.
	(.bss): Add .either.bss.
	* msp430/msp430xl-sim.ld (MEMORY): Add HIROM.
	(.rodata2): Move some read-only data sections here.
	(.upper.data): New section.  Include notes about how to initialise
	it.
This commit is contained in:
Nick Clifton
2015-05-05 12:45:38 +01:00
committed by Corinna Vinschen
parent 761a123a4f
commit baa681fd38
10 changed files with 462 additions and 793 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2013-2014 Red Hat, Inc. All rights reserved.
/* Copyright (c) 2013-2015 Red Hat, Inc. All rights reserved.
This copyrighted material is made available to anyone wishing to use, modify,
copy, or redistribute it subject to the terms and conditions of the BSD
@@ -33,11 +33,15 @@ SECTIONS
{
. = ALIGN(2);
*(.plt)
. = ALIGN(2);
*(.lower.rodata.* .lower.rodata)
. = ALIGN(2);
*(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)
. = ALIGN(2);
*(.either.rodata.* .either.rodata)
. = ALIGN(2);
*(.rodata1)
*(.eh_frame_hdr)
KEEP (*(.eh_frame))
KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
PROVIDE (__preinit_array_start = .);
KEEP (*(.preinit_array))
@@ -52,6 +56,17 @@ SECTIONS
PROVIDE (__fini_array_end = .);
LONG(0); /* Sentinel. */
} > RAM
/* Note: This is a separate .rodata section for sections which are
read only but which older linkers treat as read-write.
This prevents older linkers from marking the entire .rodata
section as read-write. */
.rodata2 : {
. = ALIGN(2);
*(.eh_frame_hdr)
KEEP (*(.eh_frame))
/* gcc uses crtbegin.o to find the start of the constructors, so
we make sure it is first. Because this is a wildcard, it
doesn't matter if the user does not actually link against
@@ -80,8 +95,9 @@ SECTIONS
PROVIDE (_start = .);
KEEP (*(SORT(.crt_*)))
*(.lowtext)
*(.lower.text.* .lower.text)
*(.lower.text.* .lower.text)
*(.text .stub .text.* .gnu.linkonce.t.* .text:*)
*(.either.text.* .either.text)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
@@ -101,11 +117,15 @@ SECTIONS
PROVIDE (__datastart = .);
*(.lower.data.* .lower.data)
*(.data .data.* .gnu.linkonce.d.*)
*(.either.data.* .either.data)
KEEP (*(.jcr))
*(.data.rel.ro.local) *(.data.rel.ro*)
*(.dynamic)
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
*(.data1)
@@ -136,6 +156,7 @@ SECTIONS
*(.dynbss)
*(.sbss .sbss.*)
*(.bss .bss.* .gnu.linkonce.b.*)
*(.either.bss.* .either.bss)
PROVIDE (__bssend = .);
} > RAM
PROVIDE (__bsssize = SIZEOF(.bss));
@@ -167,7 +188,7 @@ SECTIONS
*(.upper.data.* .upper.data)
*(.upper.bss.* .upper.bss)
*(.upper.text.* .upper.text)
ASSERT (SIZEOF(.upper) == 0, ".upper sections present in a binary linked without -mlarge support");
ASSERT (SIZEOF(.upper) == 0, "This MCU does not support high memory");
}
/* The rest are all not normally part of the runtime image. */