Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

P.300のglobal.dmpの逆アセンブラと同じものを得るには? #32

Open
m1goh opened this issue Nov 12, 2022 · 0 comments
Open

Comments

@m1goh
Copy link

m1goh commented Nov 12, 2022

P.300では、global.cをriscv32-unknown-elf-gccでコンパイルしていますが、P.69のRISC-V向けツールチェインのインストールの説明に従ってビルドした
~/riscv64_github/binには、riscv64-unknown-elf-gccはありますが、riscv32-unknown-elf-gccはありません。
~/riscv32_githubに32ビット版をビルドしようとしましたが
以下のようになってできませんでした。

akiyoshi@beetle:~$ ../configure --prefix=/riscv32_github --with-arch=rv32gc --with-abi=ilp32d
-bash: ../configure: No such file or directory

riscv32-unknown-elf-gccの代わりにriscv64-unknown-elf-gccを使用してみましたが

0000000000010106

:
10106: f581a503 lw a0,-168(gp) # 11bd0 <global_val>
1010a: 2505 addiw a0,a0,1
1010c: f4a1ac23 sw a0,-168(gp) # 11bd0 <global_val>
10110: 8082 ret

P.300のglobal.dmpの逆アセンブルの結果の様に
lui命令を使ったものが生成されません。

P.300のglobal.dmpと同じ結果が得られるようにするには、どうしたらいいですか?教えていただけるとありがたいです。
よろしくお願いします。
riscv32-unknown-elf-gccが必要な場合は、riscv32-unknown-elf-gccとriscv64-unknown-elf-gccの両方がビルドできる方法があったら教えていただきたいです。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant