aboutsummaryrefslogtreecommitdiff
path: root/libgloss/msp430/msp430-sim.ld
AgeCommit message (Collapse)AuthorFilesLines
2020-08-07MSP430: Increase the amount of main memory available in sim ld scriptsJozef Lawrynowicz1-1/+1
The main memory region of the GDB simulator ends at address 0xFFBF, but the simulator linker scripts do not make full use of this available memory. >From 61f3d212741acee583e21ff2c2808775584ecad6 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz <jozef.l@mittosystems.com> Date: Mon, 3 Aug 2020 19:38:23 +0100 Subject: [PATCH 2/2] MSP430: Increase the amount of main memory available in sim ld scripts The main memory region of the GDB simulator ends at address 0xFFBF, but the simulator linker scripts do not make full use of this available memory.
2020-08-07MSP430: Word align __*_array_start symbols in sim linker scriptsJozef Lawrynowicz1-0/+4
__{preinit,init,fini}_array_start symbols must be word aligned in linker scripts. If the section preceding the __*_array_start symbol has an odd size, then a NULL byte will be present between the start symbol and the .*_array section itself, when the section gets automatically word-aligned. This results in a branch to an invalid address when the CRT startup code tries to run through the functions listed in the array sections. >From de115144d05ecbaa82c9c737cc261715ca4b7d67 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz <jozef.l@mittosystems.com> Date: Mon, 3 Aug 2020 19:09:46 +0100 Subject: [PATCH 1/2] MSP430: Word align __*_array_start symbols in sim linker scripts __{preinit,init,fini}_array_start symbols must be word aligned in linker scripts. If the section preceding the __*_array_start symbol has an odd size, then a NULL byte will be present between the start symbol and the .*_array section itself, when the section gets automatically word-aligned. This results in a branch to an invalid address when the CRT startup code tries to run through the functions listed in the array sections.
2019-07-24MSP430: Remove .init/.fini sectionsJozef Lawrynowicz1-2/+0
The .init/.fini sections are not required for msp430-elf, and add unnecessary code bloat to the CRT library. These sections are specified as "unused" by the MSP430 EABI. .init existed to call __crt0_run_{init,preinit}_array which run through the functions in .{init,preinit}_array. __crt0_run_{init,preinit}_array are already dynamically included like the other crt0 functions, so these can be placed before the call to main, which ensures they are still called if needed. With these functions moved, .init has no purpose and can be removed. .fini existed to call __crt0_run_fini_array. However, the "__msp430_fini" symbol which marks the start of .fini has never been used, so no termination routines have ever been run for msp430. On returning from main(), _exit() is called which just loops forever. So there is no current expectation that __crt0_run_fini_array will get called by the CRT code. Further work is to ensure functions registered with atexit can be optionally called during program termination, and then __crt0_run_fini_array can be registered with atexit during program initialization. The mechanisms for supporting the "-minrt" option have also been removed. "-minrt" enabled a "minimum runtime environment" by removing calls to functions which run global static initializers and constructors. Since this behaviour is now dynamic, and these functions are only included when needed, the minrt versions of the CRT object files are no longer required.
2016-04-07Fix typo in the name of the MSP430 attribute section of example MSP430 ↵Nick Clifton1-1/+1
linker scripts.
2016-03-10Remove bogus LONG(0) directives from MSP430 linker scripts.Nick Clifton1-1/+0
2015-10-06Add support for persistent data to the MSP430 linker scripts.Nick Clifton1-6/+26
* msp430/msp430-sim.ld: Add .persistent section. Tidy up section layout. Start RAM above hardware multiply registers. * msp430/msp430xl-sim.ld: Likewise.
2015-05-27Add a check that the data area does not overrun the stack.Nick Clifton1-0/+16
* msp430/msp430-sim.ld (.stack): Add an assertion to make sure that the data area does not overrun the stack. PROVIDE a new symbol __stack_size to allow the user to set the limit. * msp430/msp430xl-sim.ld (.stack): Likewise. * rl78/rl78-sim.ld (.stack): Likewise. * rl78/rl78.ld (.stack): Likewise. * rx/rx-sim.ld (.stack): Likewise. * rx/rx.ld (.stack): Likewise.
2015-05-27Adds support for placing MSP430 code and data into either low memory or high ↵Nick Clifton1-6/+27
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.
2014-11-13 * msp430/Makefile.in (CRT_OBJS): Add crt_high_bss.o.Nick Clifton1-22/+37
* msp430/crt0.S (high_bss): Add. * msp430/msp430-sim.ld: Add error message if .upper sections are detected. * msp430/msp430xl-sim.ld (MEMORY): Adjust to better mimic real life MCUs. Add support for upper and lower sections.
2014-01-30* msp430/Makefile.in (crt0-minrt.o, crtn-minrt.o): New. BuildDJ Delorie1-6/+2
from crt0.S with -DMINRT. (CRT_OBJS): Expand. (crt_%.o): New rule pattern. Build multiple objects from crt0.S. * msp430/crt0.S: Further break out functionality. Support -DMINRT that omits all init/fini logic. * msp430/crtn.S: Likewise. * msp430/msp430-sim.ld: Wildcard all .crt_* sections, sorted. * msp430/msp430.ld: Likewise. * msp430/msp430xl-sim.ld: Likewise.
2013-09-18 * msp430/Makefile.in (SCRIPTS): Add intr_vectors.ld.Nick Clifton1-8/+25
(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-05-13[newlib]DJ Delorie1-0/+194
* configure.host (msp430): Add. * libc/include/machine/ieeefp.h: Add MSP430 support. * libc/include/machine/setjmp.h: Likewise. * libc/include/sys/config.h: Likewise. * libc/machine/configure.in (msp430): Add. * libc/machine/configure: Regenerate. * libc/machine/msp430: New directory. [libgloss] * configure.in (msp430*-*-elf): Add. * configure: Regenerate. * msp430: New directory.