fix issue of jumping to address 0

This commit is contained in:
2020-11-14 23:04:24 -07:00
parent caf9a6f4f7
commit 4a25ca6def
7 changed files with 213 additions and 154 deletions

View File

@@ -16,8 +16,8 @@ LDFLAGS = -T test.ld
%.o: %.c
$(CC) $(CFLAGS) $^ -o $@
%.elf: %.o
$(LD) $(LDFLAGS) $^ -o $@
%.elf: %.o %.ld
$(LD) $(LDFLAGS) $< -o $@
text.hex: test.elf
riscv64-linux-gnu-objdump -s $^ | sed -n '/.text/,$$p' | tail -n+2 | sed -n '/.data/,$$!p' | cut -f3-6 -d ' ' | sed -e 's/ /\n/g' | sed 's/^\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/' > $@