From da2ddb9d7ce9c341baf8e66ae872b434aaa3d97c Mon Sep 17 00:00:00 2001 From: Alexander D'hoore Date: Sun, 11 Oct 2020 18:46:26 +0200 Subject: [PATCH] llvm-objdump: Use two hyphens in flags to objdump LLVM 11 changed the behavior of these tools. See https://github.com/rust-embedded/book/issues/269 --- src/start/exceptions.md | 2 +- src/start/qemu.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/start/exceptions.md b/src/start/exceptions.md index 0aa162ad..a88319c0 100644 --- a/src/start/exceptions.md +++ b/src/start/exceptions.md @@ -249,7 +249,7 @@ If you look at the disassembly of the program: ``` console -$ cargo objdump --bin app --release -- -d -no-show-raw-insn -print-imm-hex +$ cargo objdump --bin app --release -- -d --no-show-raw-insn --print-imm-hex (..) ResetTrampoline: 8000942: movw r0, #0xfffe diff --git a/src/start/qemu.md b/src/start/qemu.md index 867bea2d..a8f7ece8 100644 --- a/src/start/qemu.md +++ b/src/start/qemu.md @@ -259,9 +259,12 @@ is. `cargo-objdump` can be used to disassemble the binary. ```console -cargo objdump --bin app --release -- -disassemble -no-show-raw-insn -print-imm-hex +cargo objdump --bin app --release -- --disassemble --no-show-raw-insn --print-imm-hex ``` +> **NOTE** if the above command complains about `Unknown command line argument` see +> the following bug report: https://github.com/rust-embedded/book/issues/269 + > **NOTE** this output can differ on your system. New versions of rustc, LLVM > and libraries can generate different assembly. We truncated some of the instructions > to keep the snippet small.