|
- /*
- * University of Bristol – Open Access Software Licence
- * Copyright (c) 2016, The University of Bristol, a chartered
- * corporation having Royal Charter number RC000648 and a charity
- * (number X1121) and its place of administration being at Senate
- * House, Tyndall Avenue, Bristol, BS8 1TH, United Kingdom.
- * All rights reserved
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. 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.
- *
- * 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 THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS 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.
- *
- * Any use of the software for scientific publications or commercial
- * purposes should be reported to the University of Bristol
- * (OSI-notifications@bristol.ac.uk and quote reference 2668). This is
- * for impact and usage monitoring purposes only.
- *
- * Enquiries about further applications and development opportunities
- * are welcome. Please contact elisabeth.oswald@bristol.ac.uk
- */
-
- /*
- * This file was based on files that are part of the libopencm3 project.
- * See below for licecning information.
- *
- * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
- * Copyright (C) 2011 Stephen Caudle <scaudle@doceme.com>
- *
- * This library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
- /* Linker script for ST STM32F0DISCOVERY (STM32F051R8T6, 64K flash, 8K RAM). */
-
- /* Define memory regions. */
- MEMORY
- {
- rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K
- }
-
- /* Generic linker script for STM32 targets using libopencm3. */
-
- /* Memory regions must be defined in the ld script which includes this one. */
-
- /* Enforce emmition of the vector table. */
- EXTERN (vector_table)
-
- /* Define the entry point of the output file. */
- ENTRY(reset_handler)
-
- /* Define sections. */
- SECTIONS
- {
- .text : {
- *(.vectors) /* Vector table */
- *(.text*) /* Program code */
- . = ALIGN(4);
- *(.rodata*) /* Read-only data */
- . = ALIGN(4);
- } >rom
-
- /* C++ Static constructors/destructors, also used for __attribute__
- * ((constructor)) and the likes */
- .preinit_array : {
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
- } >rom
- .init_array : {
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
- } >rom
- .fini_array : {
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
- } >rom
-
- /*
- * Another section used by C++ stuff, appears when using newlib with
- * 64bit (long long) printf support
- */
- .ARM.extab : {
- *(.ARM.extab*)
- } >rom
- .ARM.exidx : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >rom
-
- . = ALIGN(4);
- _etext = .;
-
- .data : {
- _data = .;
- *(.data*) /* Read-write initialized data */
- . = ALIGN(4);
- _edata = .;
- } >ram AT >rom
- _data_loadaddr = LOADADDR(.data);
-
- .bss : {
- *(.bss*) /* Read-write zero initialized data */
- *(COMMON)
- . = ALIGN(4);
- _ebss = .;
- } >ram
-
- /*
- * The .eh_frame section appears to be used for C++ exception handling.
- * You may need to fix this if you're using C++.
- */
- /DISCARD/ : { *(.eh_frame) }
-
- . = ALIGN(4);
- end = .;
- }
-
- PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram));
|