From caeb610bb911291f8ca28129b6f5ed1b494f0fec Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 22 Aug 2019 13:18:24 -0400 Subject: armcm_link: Rename armcm_boot.lds.S to armcm_link.lds.S Rename the linker script so the build does not have any conflicts with the armcm_boot.d dependency file. Signed-off-by: Kevin O'Connor --- src/atsam/Makefile | 4 +-- src/atsamd/Makefile | 4 +-- src/generic/armcm_boot.c | 2 +- src/generic/armcm_boot.lds.S | 63 -------------------------------------------- src/generic/armcm_link.lds.S | 63 ++++++++++++++++++++++++++++++++++++++++++++ src/lpc176x/Makefile | 4 +-- src/stm32/Makefile | 4 +-- 7 files changed, 72 insertions(+), 72 deletions(-) delete mode 100644 src/generic/armcm_boot.lds.S create mode 100644 src/generic/armcm_link.lds.S (limited to 'src') diff --git a/src/atsam/Makefile b/src/atsam/Makefile index 1c2dc378..35b62488 100644 --- a/src/atsam/Makefile +++ b/src/atsam/Makefile @@ -19,8 +19,8 @@ CFLAGS-$(CONFIG_MACH_SAM4E) += -Ilib/sam4e/include CFLAGS += $(CFLAGS-y) -D__$(MCU)__ -mthumb -Ilib/cmsis-core CFLAGS_klipper.elf += --specs=nano.specs --specs=nosys.specs -CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_boot.ld -$(OUT)klipper.elf: $(OUT)src/generic/armcm_boot.ld +CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_link.ld +$(OUT)klipper.elf: $(OUT)src/generic/armcm_link.ld # Add source files src-y += atsam/main.c atsam/gpio.c atsam/i2c.c atsam/spi.c atsam/hard_pwm.c diff --git a/src/atsamd/Makefile b/src/atsamd/Makefile index 82a1a4b0..4c943cbc 100644 --- a/src/atsamd/Makefile +++ b/src/atsamd/Makefile @@ -15,8 +15,8 @@ CFLAGS-$(CONFIG_MACH_SAMD51) += -mfpu=fpv4-sp-d16 -mfloat-abi=hard CFLAGS += $(CFLAGS-y) -D__$(MCU)__ -mthumb -Ilib/cmsis-core CFLAGS_klipper.elf += --specs=nano.specs --specs=nosys.specs -CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_boot.ld -$(OUT)klipper.elf: $(OUT)src/generic/armcm_boot.ld +CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_link.ld +$(OUT)klipper.elf: $(OUT)src/generic/armcm_link.ld # Add source files src-y += atsamd/main.c atsamd/gpio.c diff --git a/src/generic/armcm_boot.c b/src/generic/armcm_boot.c index c559c1c1..e11e2412 100644 --- a/src/generic/armcm_boot.c +++ b/src/generic/armcm_boot.c @@ -7,7 +7,7 @@ #include "armcm_boot.h" // DECL_ARMCM_IRQ #include "board/internal.h" // SystemInit -// Symbols created by armcm_boot.lds.S linker script +// Symbols created by armcm_link.lds.S linker script extern uint32_t _data_start, _data_end, _data_flash; extern uint32_t _bss_start, _bss_end, _stack_start; diff --git a/src/generic/armcm_boot.lds.S b/src/generic/armcm_boot.lds.S deleted file mode 100644 index 8014a490..00000000 --- a/src/generic/armcm_boot.lds.S +++ /dev/null @@ -1,63 +0,0 @@ -// Generic ARM Cortex-M linker script -// -// Copyright (C) 2019 Kevin O'Connor -// -// This file may be distributed under the terms of the GNU GPLv3 license. - -#include "autoconf.h" // CONFIG_FLASH_START - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) - -MEMORY -{ - rom (rx) : ORIGIN = CONFIG_FLASH_START , LENGTH = CONFIG_FLASH_SIZE - ram (rwx) : ORIGIN = CONFIG_RAM_START , LENGTH = CONFIG_RAM_SIZE -} - -SECTIONS -{ - .text : { - . = ALIGN(4); - KEEP(*(.vector_table)) - *(.text .text.*) - *(.rodata .rodata*) - } > rom - - . = ALIGN(4); - _data_flash = .; - - .data : AT (_data_flash) - { - . = ALIGN(4); - _data_start = .; - *(.ramfunc .ramfunc.*); - *(.data .data.*); - . = ALIGN(4); - _data_end = .; - } > ram - - .bss (NOLOAD) : - { - . = ALIGN(4); - _bss_start = .; - *(.bss .bss.*) - *(COMMON) - . = ALIGN(4); - _bss_end = .; - } > ram - - _stack_start = CONFIG_RAM_START + CONFIG_RAM_SIZE - CONFIG_STACK_SIZE ; - .stack _stack_start (NOLOAD) : - { - . = . + CONFIG_STACK_SIZE; - _stack_end = .; - } > ram - - /DISCARD/ : { - // The .init/.fini sections are used by __libc_init_array(), but - // that isn't needed so no need to include them in the binary. - *(.init) - *(.fini) - } -} diff --git a/src/generic/armcm_link.lds.S b/src/generic/armcm_link.lds.S new file mode 100644 index 00000000..8014a490 --- /dev/null +++ b/src/generic/armcm_link.lds.S @@ -0,0 +1,63 @@ +// Generic ARM Cortex-M linker script +// +// Copyright (C) 2019 Kevin O'Connor +// +// This file may be distributed under the terms of the GNU GPLv3 license. + +#include "autoconf.h" // CONFIG_FLASH_START + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) + +MEMORY +{ + rom (rx) : ORIGIN = CONFIG_FLASH_START , LENGTH = CONFIG_FLASH_SIZE + ram (rwx) : ORIGIN = CONFIG_RAM_START , LENGTH = CONFIG_RAM_SIZE +} + +SECTIONS +{ + .text : { + . = ALIGN(4); + KEEP(*(.vector_table)) + *(.text .text.*) + *(.rodata .rodata*) + } > rom + + . = ALIGN(4); + _data_flash = .; + + .data : AT (_data_flash) + { + . = ALIGN(4); + _data_start = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _data_end = .; + } > ram + + .bss (NOLOAD) : + { + . = ALIGN(4); + _bss_start = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _bss_end = .; + } > ram + + _stack_start = CONFIG_RAM_START + CONFIG_RAM_SIZE - CONFIG_STACK_SIZE ; + .stack _stack_start (NOLOAD) : + { + . = . + CONFIG_STACK_SIZE; + _stack_end = .; + } > ram + + /DISCARD/ : { + // The .init/.fini sections are used by __libc_init_array(), but + // that isn't needed so no need to include them in the binary. + *(.init) + *(.fini) + } +} diff --git a/src/lpc176x/Makefile b/src/lpc176x/Makefile index f4966ff7..ef5b0460 100644 --- a/src/lpc176x/Makefile +++ b/src/lpc176x/Makefile @@ -8,8 +8,8 @@ dirs-y += src/lpc176x src/generic lib/lpc176x/device CFLAGS += -mthumb -mcpu=cortex-m3 -Ilib/lpc176x/device -Ilib/cmsis-core CFLAGS_klipper.elf += --specs=nano.specs --specs=nosys.specs -CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_boot.ld -$(OUT)klipper.elf: $(OUT)src/generic/armcm_boot.ld +CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_link.ld +$(OUT)klipper.elf: $(OUT)src/generic/armcm_link.ld # Add source files src-y += lpc176x/main.c lpc176x/gpio.c diff --git a/src/stm32/Makefile b/src/stm32/Makefile index 144a23a2..710c9f83 100644 --- a/src/stm32/Makefile +++ b/src/stm32/Makefile @@ -16,8 +16,8 @@ CFLAGS-$(CONFIG_MACH_STM32F4) += -mfpu=fpv4-sp-d16 -mfloat-abi=hard CFLAGS += $(CFLAGS-y) -D$(MCU_UPPER) -mthumb -Ilib/cmsis-core CFLAGS_klipper.elf += --specs=nano.specs --specs=nosys.specs -CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_boot.ld -$(OUT)klipper.elf: $(OUT)src/generic/armcm_boot.ld +CFLAGS_klipper.elf += -T $(OUT)src/generic/armcm_link.ld +$(OUT)klipper.elf: $(OUT)src/generic/armcm_link.ld # Add source files src-y += stm32/main.c stm32/watchdog.c stm32/gpio.c generic/armcm_boot.c -- cgit v1.2.3-70-g09d2