diff options
author | Sergey Nazaryev <sergey@nazaryev.ru> | 2018-10-11 15:44:51 +0000 |
---|---|---|
committer | Sergey Nazaryev <sergey@nazaryev.ru> | 2018-10-11 15:52:08 +0000 |
commit | 8799ba4337025b1d74c0876179ee8e9519e349f3 (patch) | |
tree | de43e8b18b4fee3699e6025a58d00729e4e9aa9b | |
parent | 827e13c74cd8bed5b085c06acc270f71c4d4fdd9 (diff) | |
download | zybo-z7-baremetal-8799ba4337025b1d74c0876179ee8e9519e349f3.zip zybo-z7-baremetal-8799ba4337025b1d74c0876179ee8e9519e349f3.tar.gz zybo-z7-baremetal-8799ba4337025b1d74c0876179ee8e9519e349f3.tar.bz2 |
bsp: link with newlib
-rw-r--r-- | bsp/Makefile.inc | 4 | ||||
-rw-r--r-- | bsp/Zynq.ld | 8 | ||||
-rw-r--r-- | bsp/boot.S | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/bsp/Makefile.inc b/bsp/Makefile.inc index a39362e..0050e9c 100644 --- a/bsp/Makefile.inc +++ b/bsp/Makefile.inc @@ -8,7 +8,7 @@ GDB = $(CROSS_COMPILE)gdb OOCD = openocd CFLAGS = -I$(BSPDIR) -mcpu=cortex-a9 -O0 -g3 -Wall -Werror -Wpedantic -LDFLAGS = -nostdlib -T$(BSPDIR)/Zynq.ld +LDFLAGS = -T$(BSPDIR)/Zynq.ld -lc -lnosys -lg -lm ASFLAGS = -g -mcpu=cortex-a9 BSP = $(BSPDIR)/boot.S \ @@ -20,7 +20,7 @@ OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(SOURCES) $(BSP))) all: $(TARGET) $(TARGET): $(OBJECTS) - $(LD) $(LDFLAGS) -o $@ $^ + $(CC) -o $@ $^ $(LDFLAGS) @$(SZ) $(TARGET) %.o: %.S diff --git a/bsp/Zynq.ld b/bsp/Zynq.ld index e94fafc..2caee16 100644 --- a/bsp/Zynq.ld +++ b/bsp/Zynq.ld @@ -12,7 +12,7 @@ ASSERT(__stack_size, "Must provide a non-zero stack size"); /* TODO: Also make sure stack size is 32-bit aligned */ __heap_end = __stext + LENGTH(SRAM_0); -__heap_start = __end; +__heap_start = end; SECTIONS { @@ -39,13 +39,13 @@ SECTIONS .bss (NOLOAD) : { . = ALIGN(4); - __sbss = .; /* Used for zeroing bss on startup */ + __bss_start__ = .; /* Used for zeroing bss on startup */ *(.bss .bss.*) - __ebss = .; + __bss_end__ = .; } >SRAM_0 . = ALIGN(4); - __end = .; + end = .; /* Place all stacks in SRAM_1 - need to avoid filling addresses */ /* 0xfffffe00 to 0xfffffff0 - proc1 is halted running code in this range */ @@ -214,8 +214,8 @@ proc0_init: /* Clear the .bss section (zero inits) */ - ldr r1, =__sbss // where in memory is start of bss (get from linker script) - ldr r2, =__ebss // where in memory is end of bss (get from linker script) + ldr r1, =__bss_start__ // where in memory is start of bss (get from linker script) + ldr r2, =__bss_end__ // where in memory is end of bss (get from linker script) mov r3, #0 clearbss: cmp r1, r2 |