From 50ba77bea9ff670767a02fef374f8c124199fe22 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 24 Jul 2009 23:19:44 +0200 Subject: Factor out ld scripts into one common script in the lib. --- examples/fancyblink/Makefile | 5 ++-- examples/fancyblink/fancyblink.ld | 49 --------------------------------------- 2 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 examples/fancyblink/fancyblink.ld (limited to 'examples/fancyblink') diff --git a/examples/fancyblink/Makefile b/examples/fancyblink/Makefile index fde0bc8..b48c987 100644 --- a/examples/fancyblink/Makefile +++ b/examples/fancyblink/Makefile @@ -30,7 +30,8 @@ OBJDUMP = $(PREFIX)-objdump TOOLCHAIN_DIR = ../.. CFLAGS = -O0 -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \ -mcpu=cortex-m3 -mthumb -LDFLAGS = -T$(BINARY).ld -nostartfiles -L$(TOOLCHAIN_DIR)/lib +LDSCRIPT = $(TOOLCHAIN_DIR)/lib/libopenstm32.ld +LDFLAGS = -T$(LDSCRIPT) -nostartfiles -L$(TOOLCHAIN_DIR)/lib OBJS = $(BINARY).o OPENOCD = openocd @@ -52,7 +53,7 @@ images: $(BINARY) @printf " OBJDUMP $(BINARY).list\n" $(Q)$(OBJDUMP) -S $(BINARY) > $(BINARY).list -$(BINARY): $(OBJS) $(BINARY).ld +$(BINARY): $(OBJS) $(LDSCRIPT) @printf " LD $(subst $(shell pwd)/,,$(@))\n" $(Q)$(LD) $(LDFLAGS) -o $(BINARY) $(OBJS) -lopenstm32 diff --git a/examples/fancyblink/fancyblink.ld b/examples/fancyblink/fancyblink.ld deleted file mode 100644 index 2d819a7..0000000 --- a/examples/fancyblink/fancyblink.ld +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of the libopenstm32 project. - * - * Copyright (C) 2009 Uwe Hermann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* Linker script for Olimex STM32-H103 (STM32F103RBT6, 128K flash, 20K RAM). */ - -/* Define memory regions. */ -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 128K - ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K -} - -/* Define sections. */ -SECTIONS -{ - . = ORIGIN(rom); - - .text : { - *(.vectors) /* Vector table */ - *(.text) /* Program code */ - *(.rodata) /* Read-only data */ - } >rom - - . = ORIGIN(ram); - - .data : { - *(.data) /* Read-write initialized data */ - } >ram AT >rom - - .bss : { - *(.bss) /* Read-write zero initialized data */ - } >ram AT >rom -} -- cgit v1.2.3