Commit a017421c authored by Angus Ainslie's avatar Angus Ainslie

Merge branch 'fix-makefile-and-ldscript' into 'master'

Fix makefile and ldscript

See merge request !1
parents 82a75144 4380f79c
Pipeline #3568 failed with stages
CC = arm-none-eabi-gcc
OBJCOPY = arm-none-eabi-objcopy
# AFLAGS = -nostdinc -nostdlib
# CFLAGS = -nostdinc -nostdlib -W -Wall
CFLAGS += -g
CFLAGS += -march=armv7e-m -mthumb
AFLAGS += -march=armv7e-m -mthumb
OBJS = m4_start.o m4_main.o iomux-v3.o ddr_loader.o gpio.o timer.o uart.o usdhc.c spi.c
CFLAGS += -g
CFLAGS += -march=armv7e-m -mthumb -mcpu=cortex-m4 \
-mlittle-endian -mfloat-abi=softfp \
-fno-zero-initialized-in-bss \
-O2 -Os -ffunction-sections -fdata-sections
LDFLAGS := -Wl,--gc-sections -T ldscript -nostartfiles \
-Wl,-Map,m4.map,--cref,-n
OBJS := m4_start.o \
m4_main.o \
iomux-v3.o \
ddr_loader.o \
gpio.o \
timer.o \
uart.o \
usdhc.o \
spi.o
all: m4.bin
......@@ -15,10 +26,10 @@ m4.bin: m4_ocram.elf
${OBJCOPY} -O binary $^ m4.bin
m4_tcm.elf: $(OBJS)
${CC} $(CXXFLAGS) -o $@ $^ -fno-zero-initialized-in-bss -mcpu=cortex-m4 -mfloat-abi=softfp -mthumb -mlittle-endian -T ldscript -nostartfiles -Wl,-Map,m4.map,--cref,-n
${CC} $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
m4_ocram.elf: $(OBJS)
${CC} $(CXXFLAGS) -g -o $@ $^ -fno-zero-initialized-in-bss -mcpu=cortex-m4 -mfloat-abi=softfp -mthumb -mlittle-endian -T ldscript -nostartfiles -Wl,-Ttext,0x00900000,-Map,m4.map,--cref,-n
${CC} $(CXXFLAGS) -g -o $@ $^ $(LDFLAGS) -Wl,-Ttext,0x00900000
clean:
rm -f *.o m4.bin m4_ocram.elf m4_tcm.elf m4.map
......
......@@ -3,20 +3,16 @@ SECTIONS
{
.text :
{
*(.text)
*(.text.*)
KEEP(*m4_start.o(.text))
*(.text .text.*)
}
. = ALIGN(32);
.data :
{
*(.data .data.* COMMON)
}
. = ALIGN(32);
.sbss :
{
}
. = ALIGN(32);
.bss :
.rodata :
{
*(.rodata .rodata.*)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment