Skip to content

Commit 48e184b

Browse files
authored
Merge pull request #102 from Javier-varez/missingAddresses
Add missing binary addresses to memory layout and main chapters
2 parents 47db755 + 1ada4dd commit 48e184b

5 files changed

Lines changed: 24 additions & 24 deletions

File tree

ci/main/app/app.objdump

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ app: file format elf32-littlearm
33

44
Disassembly of section .text:
55

6-
<main>:
7-
push {r7, lr}
8-
mov r7, sp
9-
sub sp, #0x4
10-
movs r0, #0x2a
11-
str r0, [sp]
12-
b 0x14 <main+0xc> @ imm = #-0x2
13-
b 0x14 <main+0xc> @ imm = #-0x4
6+
00000008 <main>:
7+
8: push {r7, lr}
8+
a: mov r7, sp
9+
c: sub sp, #0x4
10+
e: movs r0, #0x2a
11+
10: str r0, [sp]
12+
12: b 0x14 <main+0xc> @ imm = #-0x2
13+
14: b 0x14 <main+0xc> @ imm = #-0x4
1414

15-
<Reset>:
16-
push {r7, lr}
17-
mov r7, sp
18-
bl 0x8 <main> @ imm = #-0x16
15+
00000016 <Reset>:
16+
16: push {r7, lr}
17+
18: mov r7, sp
18+
1a: bl 0x8 <main> @ imm = #-0x16

ci/memory-layout/app.text.objdump

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ app: file format elf32-littlearm
33

44
Disassembly of section .text:
55

6-
<Reset>:
7-
push {r7, lr}
8-
mov r7, sp
9-
sub sp, #0x4
10-
movs r0, #0x2a
11-
str r0, [sp]
12-
b 0x14 <Reset+0xc> @ imm = #-0x2
13-
b 0x14 <Reset+0xc> @ imm = #-0x4
6+
00000008 <Reset>:
7+
8: push {r7, lr}
8+
a: mov r7, sp
9+
c: sub sp, #0x4
10+
e: movs r0, #0x2a
11+
10: str r0, [sp]
12+
12: b 0x14 <Reset+0xc> @ imm = #-0x2
13+
14: b 0x14 <Reset+0xc> @ imm = #-0x4

ci/script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ main() {
5252

5353
# check that the Reset symbol is there
5454
diff -b app.text.objdump \
55-
<(cargo objdump --bin app -- -d --no-show-raw-insn --no-leading-addr)
55+
<(cargo objdump --bin app -- -d --no-show-raw-insn --print-imm-hex)
5656

5757
# check that the reset vector is there and has the right address
5858
diff -b app.vector_table.objdump \
@@ -70,7 +70,7 @@ main() {
7070
# check that the disassembly matches
7171
pushd app
7272
diff -b app.objdump \
73-
<(cargo objdump --bin app -- -d --no-show-raw-insn --no-leading-addr)
73+
<(cargo objdump --bin app -- -d --no-show-raw-insn --print-imm-hex)
7474
# disabled because of rust-lang/rust#53964
7575
# edition_check
7676
popd

src/main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ $ cat src/main.rs
8989
The disassembly will be similar but will now include the user `main` function.
9090

9191
``` console
92-
$ cargo objdump --bin app -- -d --no-show-raw-insn
92+
$ cargo objdump --bin app -- -d --no-show-raw-insn --print-imm-hex
9393
```
9494

9595
``` text

src/memory-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Now let's inspect the output binary to confirm the memory layout looks the way w
214214
(this requires [`cargo-binutils`](https://github.com/rust-embedded/cargo-binutils#readme)):
215215

216216
``` console
217-
$ cargo objdump --bin app -- -d --no-show-raw-insn
217+
$ cargo objdump --bin app -- -d --no-show-raw-insn --print-imm-hex
218218
```
219219

220220
``` text

0 commit comments

Comments
 (0)