Skip to content

Commit 3bc1928

Browse files
theotherjimmyadbridge
authored andcommitted
Test gcc memap parser with compiler provided .o's
1 parent be42b0d commit 3bc1928

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

tools/test/memap/gcc.map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Linker script and memory map
88
0x000000000001b200 0xc0 /common/path/startup/startup.o
99
0x000000000001b200 startup()
1010
0x0000000000024020 0x8 /usr/lib/gcc/arm-none-eabi/7.1.0/../../../../arm-none-eabi/lib/armv6-m/libd16M_tlf.a(__main.o)
11+
0x0000000000024020 0x8 /usr/lib/gcc/arm-none-eabi/7.1.0/../../../../arm-none-eabi/lib/armv6-m/foo.o
1112

1213
.data 0x0000000020002ef8 0xac8 load address 0x000000000002ca38
1314
0x0000000020002ef8 __data_start__ = .

tools/test/memap/parse_test.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_parse_armcc():
2424
memap.parse(join(dirname(__file__), "arm.map"), "UARM")
2525
assert memap.modules == PARSED_ARM_DATA
2626

27-
PARSED_IAR_GCC_DATA = {
27+
PARSED_IAR_DATA = {
2828
"startup/startup.o": {".text": 0xc0},
2929
"[lib]/d16M_tlf.a/__main.o": {".text": 8},
3030
"irqs/irqs.o": {".text": 0x98},
@@ -35,14 +35,23 @@ def test_parse_armcc():
3535
def test_parse_iar():
3636
memap = MemapParser()
3737
memap.parse(join(dirname(__file__), "iar.map"), "IAR")
38-
assert memap.modules == PARSED_IAR_GCC_DATA
38+
assert memap.modules == PARSED_IAR_DATA
39+
40+
PARSED_GCC_DATA = {
41+
"startup/startup.o": {".text": 0xc0},
42+
"[lib]/d16M_tlf.a/__main.o": {".text": 8},
43+
"[lib]/misc/foo.o": {".text": 8},
44+
"irqs/irqs.o": {".text": 0x98},
45+
"data/data.o": {".data": 0x18, ".bss": 0x198},
46+
"main.o": {".text": 0x36},
47+
}
3948

4049
def test_parse_gcc():
4150
memap = MemapParser()
4251
memap.parse(join(dirname(__file__), "gcc.map"), "GCC_ARM")
43-
assert memap.modules == PARSED_IAR_GCC_DATA
52+
assert memap.modules == PARSED_GCC_DATA
4453
memap.parse(join(dirname(__file__), "gcc.map"), "GCC_CR")
45-
assert memap.modules == PARSED_IAR_GCC_DATA
54+
assert memap.modules == PARSED_GCC_DATA
4655

4756

4857
def test_add_empty_module():

0 commit comments

Comments
 (0)