separate .text and .data for instruction and data memory
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
all: test.hex
|
||||
all: text.hex data.hex
|
||||
|
||||
CC = riscv64-linux-gnu-gcc
|
||||
# CFLAGS = -march=rv32i -mabi=ilp32
|
||||
@@ -19,5 +19,11 @@ LDFLAGS = -T test.ld
|
||||
%.elf: %.o
|
||||
$(LD) $(LDFLAGS) $^ -o $@
|
||||
|
||||
test.hex: test.elf
|
||||
riscv64-linux-gnu-objdump -s $^ | sed -n '/0000/,$$p' | cut -f3-6 -d ' ' | sed -e 's/ /\n/g' | sed 's/^\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/' > $@
|
||||
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/' > $@
|
||||
|
||||
data.hex: test.elf
|
||||
riscv64-linux-gnu-objdump -s $^ | sed -n '/.data/,$$p' | tail -n+2 | sed -n '/.bss/,$$!p' | cut -f3-6 -d ' ' | sed -e 's/ /\n/g' | sed 's/^\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/' > $@
|
||||
|
||||
clean:
|
||||
rm test.elf text.hex data.hex
|
Reference in New Issue
Block a user