Skip to content

Commit 6542db3

Browse files
OSU: PIC - Disable relocation of addresses in RAM
In the context of an OSU, the `pic` function used to link addresses in RAM. Those addresses are already known at compile time. Applying this relocation triggered incorrect behaviors. (cherry picked from commit 8f7135c)
1 parent a084088 commit 6542db3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ void *pic(void *link_address)
5353
link_address = pic_internal(link_address);
5454
}
5555

56+
#ifndef BOLOS_OS_UPGRADER_APP
5657
// check if in the LINKED RAM zone
5758
__asm volatile("ldr %0, =_bss" : "=r"(n));
5859
__asm volatile("ldr %0, =_estack" : "=r"(en));
@@ -61,6 +62,7 @@ void *pic(void *link_address)
6162
// deref into the RAM therefore add the RAM offset from R9
6263
link_address = (char *) link_address - (char *) n + (char *) en;
6364
}
65+
#endif // BOLOS_OS_UPGRADER_APP
6466

6567
return link_address;
6668
}

0 commit comments

Comments
 (0)