Skip to content

Commit

Permalink
fix: classroom wave player, gc-sections in compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
sylefeb committed Dec 28, 2024
1 parent bde2feb commit 30e27de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions learn-silice/classroom/soc_wave_player/firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ LD = $(ARCH)-ld
OBJS = sdcard.o div.o std.o config.o oled.o display.o printf.o mul.o crt0.o fat_io_lib.o

$(PRGS): %: %.o $(OBJS)
$(LD) -m elf32lriscv -b elf32-littleriscv -Tconfig_c.ld --no-relax -o code.elf $^
$(LD) --gc-sections -m elf32lriscv -b elf32-littleriscv -Tconfig_c.ld --no-relax -o code.elf $^
$(ARCH)-objcopy -O verilog code.elf code.hex
$(ARCH)-objdump --disassemble code.elf > code.s

%.o : %.c
$(CC) -U_FORTIFY_SOURCE -fno-builtin -fno-unroll-loops $(DEFINES) -Os -fno-stack-protector -fno-pic -march=rv32i -mabi=ilp32 -c $< -o $@
$(CC) -ffunction-sections -fdata-sections -U_FORTIFY_SOURCE -fno-builtin -fno-unroll-loops $(DEFINES) -Os -fno-stack-protector -fno-pic -march=rv32i -mabi=ilp32 -c $< -o $@

%.o : %.s
$(AS) -march=rv32i -mabi=ilp32 $< -o $@
Expand Down
16 changes: 8 additions & 8 deletions learn-silice/classroom/soc_wave_player/firmware/config_c.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ SECTIONS {
__stacktop = ORIGIN(ram) + LENGTH(ram);

.text 0x00000000 : {
crt0.o (.text)
*(.text)
*(.sdata)
*(.srodata)
*(.rodata)
*(.rodata.str1.4)
*(.data)
*(.sbss)
crt0.o (.text*)
*(.text*)
*(.sdata*)
*(.srodata*)
*(.rodata*)
*(.rodata.str1.4*)
*(.data*)
*(.sbss*)
} >ram
}

0 comments on commit 30e27de

Please sign in to comment.