* msp430/Makefile.in (SCRIPTS): Add intr_vectors.ld.

(LIB_CRT): New.
	(CRT_OBJS): New.
	(all): Add dependency upon LIB_CRT.
	(install): Likewise.
	* msp430/msp430-sim.ld: Include intr_vectors.ld.
	KEEP crt code, lowtext code and tm_clone_table.
	Separate the noinit section from the .bss section.
	Allow for extended .debug_line sections.
	* msp430/msp430.ld: Likewise.
	* msp430/msp430F5438A-l.ld: Likewise.
	* msp430/msp430F5438A-s.ld: Likewise.
	* msp430/msp430xl-sim.ld: Likewise
.	* msp430/crt_movedata.S: New.
	* msp430/crt_bss.S: New.
	* msp430/intr_vectors.ld: New.
This commit is contained in:
Nick Clifton 2013-09-18 07:38:13 +00:00
parent 37e1d79259
commit 796a9241b3
10 changed files with 318 additions and 40 deletions

View File

@ -1,3 +1,22 @@
2013-09-18 Nick Clifton <nickc@redhat.com>
* msp430/Makefile.in (SCRIPTS): Add intr_vectors.ld.
(LIB_CRT): New.
(CRT_OBJS): New.
(all): Add dependency upon LIB_CRT.
(install): Likewise.
* msp430/msp430-sim.ld: Include intr_vectors.ld.
KEEP crt code, lowtext code and tm_clone_table.
Separate the noinit section from the .bss section.
Allow for extended .debug_line sections.
* msp430/msp430.ld: Likewise.
* msp430/msp430F5438A-l.ld: Likewise.
* msp430/msp430F5438A-s.ld: Likewise.
* msp430/msp430xl-sim.ld: Likewise
. * msp430/crt_movedata.S: New.
* msp430/crt_bss.S: New.
* msp430/intr_vectors.ld: New.
2013-09-17 Joey Ye <joey.ye@arm.com> 2013-09-17 Joey Ye <joey.ye@arm.com>
* libnosys/Makefile.in: Install nosys.specs. * libnosys/Makefile.in: Install nosys.specs.

View File

@ -60,6 +60,7 @@ SCRIPTS = $(srcdir)/msp430.ld $(srcdir)/msp430-sim.ld
SCRIPTS += $(srcdir)/msp430xl-sim.ld SCRIPTS += $(srcdir)/msp430xl-sim.ld
SCRIPTS += $(srcdir)/msp430F5438A-s.ld SCRIPTS += $(srcdir)/msp430F5438A-s.ld
SCRIPTS += $(srcdir)/msp430F5438A-l.ld SCRIPTS += $(srcdir)/msp430F5438A-l.ld
CRT = gcrt0.o crt0.o crtn.o CRT = gcrt0.o crt0.o crtn.o
SIM_BSP = libsim.a SIM_BSP = libsim.a
LIBNOSYS = libnosys.a LIBNOSYS = libnosys.a
@ -74,6 +75,12 @@ NOSYS_OBJS = nosyscalls.o \
write.o \ write.o \
sbrk.o sbrk.o
SCRIPTS += $(srcdir)/intr_vectors.ld
LIB_CRT = libcrt.a
CRT_OBJS = crt_bss.o crt_movedata.o
#### Host specific Makefile fragment comes in here. #### Host specific Makefile fragment comes in here.
@host_makefile_frag@ @host_makefile_frag@
@ -82,17 +89,20 @@ NOSYS_OBJS = nosyscalls.o \
.S.o: .S.o:
$(CC) -Wa,-gdwarf2 -Wa,-I$(srcdir) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $< $(CC) -Wa,-gdwarf2 -Wa,-I$(srcdir) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $<
all: $(CRT) $(SIM_BSP) $(LIBNOSYS) copy_scripts_to_objdir all: $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT) copy_scripts_to_objdir
$(SIM_BSP): $(SIM_OBJS) $(SIM_BSP): $(SIM_OBJS)
$(AR) $(ARFLAGS) $@ $? $(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@ $(RANLIB) $@
$(LIBNOSYS): $(NOSYS_OBJS) $(LIBNOSYS): $(NOSYS_OBJS)
$(AR) $(ARFLAGS) $@ $? $(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@ $(RANLIB) $@
$(LIB_CRT): $(CRT_OBJS)
$(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@
copy_scripts_to_objdir: $(SCRIPTS) copy_scripts_to_objdir: $(SCRIPTS)
cp $(SCRIPTS) $(objdir) cp $(SCRIPTS) $(objdir)
@ -126,8 +136,8 @@ unlink.o : $(SDEPS)
utime.o : $(SDEPS) utime.o : $(SDEPS)
write.o : $(SDEPS) write.o : $(SDEPS)
install: $(CRT) $(SIM_BSP) $(LIBNOSYS) $(SCRIPTS) install: $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT) $(SCRIPTS)
for c in $(CRT) $(SIM_BSP) $(LIBNOSYS); do \ for c in $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT); do \
$(INSTALL_DATA) $$c $(tooldir)/lib${MULTISUBDIR}/$$c ;\ $(INSTALL_DATA) $$c $(tooldir)/lib${MULTISUBDIR}/$$c ;\
done done
for c in $(SCRIPTS); do \ for c in $(SCRIPTS); do \

44
libgloss/msp430/crt_bss.S Normal file
View File

@ -0,0 +1,44 @@
/* Copyright (c) 2012-2013 Red Hat Incorporated.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
The name of Red Hat Incorporated may not be used to endorse
or promote products derived from this software without specific
prior written permission.
This software is provided by the copyright holders and contributors
"AS IS" and any express or implied warranties, including, but not
limited to, the implied warranties of merchantability and fitness for
a particular purpose are disclaimed. In no event shall Red Hat
incorporated be liable for any direct, indirect, incidental, special,
exemplary, or consequential damages (including, but not limited to,
procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including
negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage. */
#include "memmodel.h"
.section ".crt_bss", "ax", @progbits
.global __crt0_init_bss
__crt0_init_bss:
mov_ #__bssstart, R12
clr.w R13
mov.w #__bsssize, R14
#ifdef __MSP430X_LARGE__
clr.w R15 ; We assume that __bsssize is never > 64M
#endif
call_ #memset

View File

@ -0,0 +1,50 @@
/* Copyright (c) 2012-2013 Red Hat Incorporated.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
The name of Red Hat Incorporated may not be used to endorse
or promote products derived from this software without specific
prior written permission.
This software is provided by the copyright holders and contributors
"AS IS" and any express or implied warranties, including, but not
limited to, the implied warranties of merchantability and fitness for
a particular purpose are disclaimed. In no event shall Red Hat
incorporated be liable for any direct, indirect, incidental, special,
exemplary, or consequential damages (including, but not limited to,
procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including
negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage. */
#include "memmodel.h"
.section ".crt_movedata", "ax", @progbits
.global __crt0_movedata
__crt0_movedata:
mov_ #__datastart, R12
mov_ #__romdatastart, R13
;; memmove and memcpy do not currently work when src == dst
cmp_ R12, R13
jeq 1f
mov.w #__romdatacopysize, R14
#ifdef __MSP430X_LARGE__
clr.w R15 ; We assume that __romdatacopysize is never > 64M
#endif
call_ #memmove
1:

View File

@ -0,0 +1,71 @@
MEMORY
{
VECT0 (w) : ORIGIN = 0x0FFC0, LENGTH = 2
VECT1 (w) : ORIGIN = 0x0FFC2, LENGTH = 2
VECT2 (w) : ORIGIN = 0x0FFC4, LENGTH = 2
VECT3 (w) : ORIGIN = 0x0FFC6, LENGTH = 2
VECT4 (w) : ORIGIN = 0x0FFC8, LENGTH = 2
VECT5 (w) : ORIGIN = 0x0FFCA, LENGTH = 2
VECT6 (w) : ORIGIN = 0x0FFCC, LENGTH = 2
VECT7 (w) : ORIGIN = 0x0FFCE, LENGTH = 2
VECT8 (w) : ORIGIN = 0x0FFD0, LENGTH = 2
VECT9 (w) : ORIGIN = 0x0FFD2, LENGTH = 2
VECT10 (w) : ORIGIN = 0x0FFD4, LENGTH = 2
VECT11 (w) : ORIGIN = 0x0FFD6, LENGTH = 2
VECT12 (w) : ORIGIN = 0x0FFD8, LENGTH = 2
VECT13 (w) : ORIGIN = 0x0FFDA, LENGTH = 2
VECT14 (w) : ORIGIN = 0x0FFDC, LENGTH = 2
VECT15 (w) : ORIGIN = 0x0FFDE, LENGTH = 2
VECT16 (w) : ORIGIN = 0x0FFE0, LENGTH = 2
VECT17 (w) : ORIGIN = 0x0FFE2, LENGTH = 2
VECT18 (w) : ORIGIN = 0x0FFE4, LENGTH = 2
VECT19 (w) : ORIGIN = 0x0FFE6, LENGTH = 2
VECT20 (w) : ORIGIN = 0x0FFE8, LENGTH = 2
VECT21 (w) : ORIGIN = 0x0FFEA, LENGTH = 2
VECT22 (w) : ORIGIN = 0x0FFEC, LENGTH = 2
VECT23 (w) : ORIGIN = 0x0FFEE, LENGTH = 2
VECT24 (w) : ORIGIN = 0x0FFF0, LENGTH = 2
VECT25 (w) : ORIGIN = 0x0FFF2, LENGTH = 2
VECT26 (w) : ORIGIN = 0x0FFF4, LENGTH = 2
VECT27 (w) : ORIGIN = 0x0FFF6, LENGTH = 2
VECT28 (w) : ORIGIN = 0x0FFF8, LENGTH = 2
VECT29 (w) : ORIGIN = 0x0FFFA, LENGTH = 2
VECT30 (w) : ORIGIN = 0x0FFFC, LENGTH = 2
VECT31 (w) : ORIGIN = 0x0FFFE, LENGTH = 2
}
SECTIONS
{
__interrupt_vector_0 : { KEEP (*(__interrupt_vector_0)) } > VECT0
__interrupt_vector_1 : { KEEP (*(__interrupt_vector_1)) } > VECT1
__interrupt_vector_2 : { KEEP (*(__interrupt_vector_2)) } > VECT2
__interrupt_vector_3 : { KEEP (*(__interrupt_vector_3)) } > VECT3
__interrupt_vector_4 : { KEEP (*(__interrupt_vector_4)) } > VECT4
__interrupt_vector_5 : { KEEP (*(__interrupt_vector_5)) } > VECT5
__interrupt_vector_6 : { KEEP (*(__interrupt_vector_6)) } > VECT6
__interrupt_vector_7 : { KEEP (*(__interrupt_vector_7)) } > VECT7
__interrupt_vector_8 : { KEEP (*(__interrupt_vector_8)) } > VECT8
__interrupt_vector_9 : { KEEP (*(__interrupt_vector_9)) } > VECT9
__interrupt_vector_10 : { KEEP (*(__interrupt_vector_10)) } > VECT10
__interrupt_vector_11 : { KEEP (*(__interrupt_vector_11)) } > VECT11
__interrupt_vector_12 : { KEEP (*(__interrupt_vector_12)) } > VECT12
__interrupt_vector_13 : { KEEP (*(__interrupt_vector_13)) } > VECT13
__interrupt_vector_14 : { KEEP (*(__interrupt_vector_14)) } > VECT14
__interrupt_vector_15 : { KEEP (*(__interrupt_vector_15)) } > VECT15
__interrupt_vector_16 : { KEEP (*(__interrupt_vector_16)) } > VECT16
__interrupt_vector_17 : { KEEP (*(__interrupt_vector_17)) } > VECT17
__interrupt_vector_18 : { KEEP (*(__interrupt_vector_18)) } > VECT18
__interrupt_vector_19 : { KEEP (*(__interrupt_vector_19)) } > VECT19
__interrupt_vector_20 : { KEEP (*(__interrupt_vector_20)) } > VECT20
__interrupt_vector_21 : { KEEP (*(__interrupt_vector_21)) } > VECT21
__interrupt_vector_22 : { KEEP (*(__interrupt_vector_22)) } > VECT22
__interrupt_vector_23 : { KEEP (*(__interrupt_vector_23)) } > VECT23
__interrupt_vector_24 : { KEEP (*(__interrupt_vector_24)) } > VECT24
__interrupt_vector_25 : { KEEP (*(__interrupt_vector_25)) } > VECT25
__interrupt_vector_26 : { KEEP (*(__interrupt_vector_26)) KEEP (*(__interrupt_vector_watchdog)) } > VECT26
__interrupt_vector_27 : { KEEP (*(__interrupt_vector_27)) } > VECT27
__interrupt_vector_28 : { KEEP (*(__interrupt_vector_28)) } > VECT28
__interrupt_vector_29 : { KEEP (*(__interrupt_vector_29)) } > VECT29
__interrupt_vector_30 : { KEEP (*(__interrupt_vector_30)) KEEP (*(__interrupt_vector_nmi)) } > VECT30
__interrupt_vector_31 : { KEEP (*(__interrupt_vector_31)) KEEP (*(__interrupt_vector_reset)) KEEP (*(.resetvec)) } > VECT31
}

View File

@ -18,7 +18,10 @@ ENTRY(_start)
/* Do we need any of these for elf? /* Do we need any of these for elf?
__DYNAMIC = 0; */ __DYNAMIC = 0; */
MEMORY { INCLUDE intr_vectors.ld
MEMORY
{
RAM (w) : ORIGIN = 0x00200, LENGTH = 0x0ee00 RAM (w) : ORIGIN = 0x00200, LENGTH = 0x0ee00
RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002 RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002
} }
@ -77,7 +80,12 @@ SECTIONS
{ {
. = ALIGN(2); . = ALIGN(2);
PROVIDE (_start = .); PROVIDE (_start = .);
*(.lowtext .text .stub .text.* .gnu.linkonce.t.* .text:*) KEEP (*(.crt_init))
KEEP (*(.crt_bss))
KEEP (*(.crt_movedata))
KEEP (*(.crt_main))
KEEP (*(.lowtext))
*(.text .stub .text.* .gnu.linkonce.t.* .text:*)
KEEP (*(.text.*personality*)) KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
@ -88,6 +96,7 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
KEEP (*(.init)) KEEP (*(.init))
KEEP (*(.fini)) KEEP (*(.fini))
KEEP (*(.tm_clone_table))
} > RAM } > RAM
.data : { .data : {
@ -127,15 +136,23 @@ SECTIONS
*(.dynbss) *(.dynbss)
*(.sbss .sbss.*) *(.sbss .sbss.*)
*(.bss .bss.* .gnu.linkonce.b.*) *(.bss .bss.* .gnu.linkonce.b.*)
. = ALIGN(2);
*(COMMON)
. = ALIGN(2);
PROVIDE (__bssend = .); PROVIDE (__bssend = .);
_end = .;
PROVIDE (end = .);
} > RAM } > RAM
PROVIDE (__bsssize = SIZEOF(.bss)); PROVIDE (__bsssize = SIZEOF(.bss));
/* This section contains data that is not initialised at startup. */
.noinit : {
. = ALIGN(2);
PROVIDE (__noinit_start = .);
*(.noinit)
. = ALIGN(2);
*(COMMON)
PROVIDE (__noinit_end = .);
} > RAM
_end = .;
PROVIDE (end = .);
.stack (ORIGIN (RAM) + LENGTH(RAM)) : .stack (ORIGIN (RAM) + LENGTH(RAM)) :
{ {
PROVIDE (__stack = .); PROVIDE (__stack = .);
@ -174,7 +191,7 @@ SECTIONS
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }

View File

@ -18,6 +18,8 @@ ENTRY(_start)
/* Do we need any of these for elf? /* Do we need any of these for elf?
__DYNAMIC = 0; */ __DYNAMIC = 0; */
INCLUDE intr_vectors.ld
MEMORY { MEMORY {
RAM (w) : ORIGIN = 0x00200, LENGTH = 0x0ee00 RAM (w) : ORIGIN = 0x00200, LENGTH = 0x0ee00
RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002 RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002
@ -77,7 +79,12 @@ SECTIONS
{ {
. = ALIGN(2); . = ALIGN(2);
PROVIDE (_start = .); PROVIDE (_start = .);
*(.lowtext .text .stub .text.* .gnu.linkonce.t.* .text:*) KEEP (*(.crt_init))
KEEP (*(.crt_bss))
KEEP (*(.crt_movedata))
KEEP (*(.crt_main))
KEEP (*(.lowtext))
*(.text .stub .text.* .gnu.linkonce.t.* .text:*)
KEEP (*(.text.*personality*)) KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
@ -88,6 +95,7 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
KEEP (*(.init)) KEEP (*(.init))
KEEP (*(.fini)) KEEP (*(.fini))
KEEP (*(.tm_clone_table))
} > RAM } > RAM
.data : { .data : {
@ -127,15 +135,23 @@ SECTIONS
*(.dynbss) *(.dynbss)
*(.sbss .sbss.*) *(.sbss .sbss.*)
*(.bss .bss.* .gnu.linkonce.b.*) *(.bss .bss.* .gnu.linkonce.b.*)
. = ALIGN(2);
*(COMMON)
. = ALIGN(2);
PROVIDE (__bssend = .); PROVIDE (__bssend = .);
_end = .;
PROVIDE (end = .);
} > RAM } > RAM
PROVIDE (__bsssize = SIZEOF(.bss)); PROVIDE (__bsssize = SIZEOF(.bss));
/* This section contains data that is not initialised at startup. */
.noinit : {
. = ALIGN(2);
PROVIDE (__noinit_start = .);
*(.noinit)
. = ALIGN(2);
*(COMMON)
PROVIDE (__noinit_end = .);
} > RAM
_end = .;
PROVIDE (end = .);
.stack (ORIGIN (RAM) + LENGTH(RAM)) : .stack (ORIGIN (RAM) + LENGTH(RAM)) :
{ {
PROVIDE (__stack = .); PROVIDE (__stack = .);
@ -174,7 +190,7 @@ SECTIONS
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }

View File

@ -15,10 +15,13 @@
OUTPUT_ARCH(msp430) OUTPUT_ARCH(msp430)
ENTRY(_start) ENTRY(_start)
INCLUDE intr_vectors.ld
/* Do we need any of these for elf? /* Do we need any of these for elf?
__DYNAMIC = 0; */ __DYNAMIC = 0; */
MEMORY { MEMORY
{
RAM (w) : ORIGIN = 0x01c00, LENGTH = 0x04000 RAM (w) : ORIGIN = 0x01c00, LENGTH = 0x04000
LOWROM (w) : ORIGIN = 0x05c00, LENGTH = 0x0a3fe LOWROM (w) : ORIGIN = 0x05c00, LENGTH = 0x0a3fe
RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002 RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002
@ -113,14 +116,23 @@ SECTIONS
*(.sbss .sbss.*) *(.sbss .sbss.*)
*(.bss .bss.* .gnu.linkonce.b.*) *(.bss .bss.* .gnu.linkonce.b.*)
. = ALIGN(2); . = ALIGN(2);
*(COMMON)
. = ALIGN(2);
PROVIDE (__bssend = .); PROVIDE (__bssend = .);
_end = .;
PROVIDE (end = .);
} > RAM } > RAM
PROVIDE (__bsssize = SIZEOF(.bss)); PROVIDE (__bsssize = SIZEOF(.bss));
/* This section contains data that is not initialised at startup. */
.noinit : {
. = ALIGN(2);
PROVIDE (__noinit_start = .);
*(.noinit)
. = ALIGN(2);
*(COMMON)
PROVIDE (__noinit_end = .);
} > RAM
_end = .;
PROVIDE (end = .);
.stack (ORIGIN (RAM) + LENGTH(RAM)) : .stack (ORIGIN (RAM) + LENGTH(RAM)) :
{ {
PROVIDE (__stack = .); PROVIDE (__stack = .);
@ -132,7 +144,11 @@ SECTIONS
{ {
PROVIDE (_start = .); PROVIDE (_start = .);
. = ALIGN(2); . = ALIGN(2);
*(.lowtext) KEEP (*(.crt_init))
KEEP (*(.crt_bss))
KEEP (*(.crt_movedata))
KEEP (*(.crt_main))
KEEP (*(.lowtext))
} > LOWROM } > LOWROM
.text : .text :
@ -149,6 +165,7 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
KEEP (*(.init)) KEEP (*(.init))
KEEP (*(.fini)) KEEP (*(.fini))
KEEP (*(.tm_clone_table))
} > ROM } > ROM
/* The rest are all not normally part of the runtime image. */ /* The rest are all not normally part of the runtime image. */
@ -183,7 +200,7 @@ SECTIONS
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }

View File

@ -15,10 +15,13 @@
OUTPUT_ARCH(msp430) OUTPUT_ARCH(msp430)
ENTRY(_start) ENTRY(_start)
INCLUDE intr_vectors.ld
/* Do we need any of these for elf? /* Do we need any of these for elf?
__DYNAMIC = 0; */ __DYNAMIC = 0; */
MEMORY { MEMORY
{
RAM (w) : ORIGIN = 0x01c00, LENGTH = 0x04000 RAM (w) : ORIGIN = 0x01c00, LENGTH = 0x04000
ROM (w) : ORIGIN = 0x05c00, LENGTH = 0x0a3fe ROM (w) : ORIGIN = 0x05c00, LENGTH = 0x0a3fe
RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002 RESETVEC (w) : ORIGIN = 0x0fffe, LENGTH = 0x00002
@ -78,7 +81,12 @@ SECTIONS
{ {
. = ALIGN(2); . = ALIGN(2);
PROVIDE (_start = .); PROVIDE (_start = .);
*(.lowtext .text .stub .text.* .gnu.linkonce.t.* .text:*) KEEP (*(.crt_init))
KEEP (*(.crt_bss))
KEEP (*(.crt_movedata))
KEEP (*(.crt_main))
KEEP (*(.lowtext))
*(.text .stub .text.* .gnu.linkonce.t.* .text:*)
KEEP (*(.text.*personality*)) KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
@ -89,6 +97,7 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
KEEP (*(.init)) KEEP (*(.init))
KEEP (*(.fini)) KEEP (*(.fini))
KEEP (*(.tm_clone_table))
} > ROM } > ROM
.data : { .data : {
@ -128,15 +137,23 @@ SECTIONS
*(.dynbss) *(.dynbss)
*(.sbss .sbss.*) *(.sbss .sbss.*)
*(.bss .bss.* .gnu.linkonce.b.*) *(.bss .bss.* .gnu.linkonce.b.*)
. = ALIGN(2);
*(COMMON)
. = ALIGN(2);
PROVIDE (__bssend = .); PROVIDE (__bssend = .);
_end = .;
PROVIDE (end = .);
} > RAM } > RAM
PROVIDE (__bsssize = SIZEOF(.bss)); PROVIDE (__bsssize = SIZEOF(.bss));
/* This section contains data that is not initialised at startup. */
.noinit : {
. = ALIGN(2);
PROVIDE (__noinit_start = .);
*(.noinit)
. = ALIGN(2);
*(COMMON)
PROVIDE (__noinit_end = .);
} > RAM
_end = .;
PROVIDE (end = .);
.stack (ORIGIN (RAM) + LENGTH(RAM)) : .stack (ORIGIN (RAM) + LENGTH(RAM)) :
{ {
PROVIDE (__stack = .); PROVIDE (__stack = .);
@ -175,7 +192,7 @@ SECTIONS
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }

View File

@ -19,6 +19,8 @@ ENTRY(_start)
/* Do we need any of these for elf? /* Do we need any of these for elf?
__DYNAMIC = 0; */ __DYNAMIC = 0; */
INCLUDE intr_vectors.ld
MEMORY { MEMORY {
RAM (rx) : ORIGIN = 0x00200, LENGTH = 0x0ee00 RAM (rx) : ORIGIN = 0x00200, LENGTH = 0x0ee00
LOWROM (w) : ORIGIN = 0x0f000, LENGTH = 0x00800 LOWROM (w) : ORIGIN = 0x0f000, LENGTH = 0x00800
@ -114,14 +116,23 @@ SECTIONS
*(.sbss .sbss.*) *(.sbss .sbss.*)
*(.bss .bss.* .gnu.linkonce.b.*) *(.bss .bss.* .gnu.linkonce.b.*)
. = ALIGN(2); . = ALIGN(2);
*(COMMON)
. = ALIGN(2);
PROVIDE (__bssend = .); PROVIDE (__bssend = .);
_end = .;
PROVIDE (end = .);
} > RAM } > RAM
PROVIDE (__bsssize = SIZEOF(.bss)); PROVIDE (__bsssize = SIZEOF(.bss));
/* This section contains data that is not initialised at startup. */
.noinit : {
. = ALIGN(2);
PROVIDE (__noinit_start = .);
*(.noinit)
. = ALIGN(2);
*(COMMON)
PROVIDE (__noinit_end = .);
} > RAM
_end = .;
PROVIDE (end = .);
.stack (ORIGIN (RAM) + LENGTH(RAM)) : .stack (ORIGIN (RAM) + LENGTH(RAM)) :
{ {
PROVIDE (__stack = .); PROVIDE (__stack = .);
@ -133,8 +144,13 @@ SECTIONS
{ {
PROVIDE (_start = .); PROVIDE (_start = .);
. = ALIGN(2); . = ALIGN(2);
*(.lowtext) KEEP (*(.crt_init))
KEEP (*(.crt_bss))
KEEP (*(.crt_movedata))
KEEP (*(.crt_main))
KEEP (*(.lowtext))
} > LOWROM } > LOWROM
.text : .text :
{ {
. = ALIGN(2); . = ALIGN(2);
@ -149,6 +165,7 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
KEEP (*(.init)) KEEP (*(.init))
KEEP (*(.fini)) KEEP (*(.fini))
KEEP (*(.tm_clone_table))
} > ROM } > ROM
/* The rest are all not normally part of the runtime image. */ /* The rest are all not normally part of the runtime image. */
@ -183,7 +200,7 @@ SECTIONS
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }