Skip to content

Commit

Permalink
src/pic.c: Restore PIC functionnality on all linked text zone
Browse files Browse the repository at this point in the history
Following previous commit, this now included the install_parameters that
are added during the build process.

(cherry picked from commit 2a823e5)
  • Loading branch information
Xavier Chapron committed Dec 5, 2023
1 parent 9a2abdb commit 09dce6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ __attribute__((naked, no_instrument_function)) void *pic_internal(void *link_add
// only apply PIC conversion if link_address is in linked code (over 0xC0D00000 in our example)
// this way, PIC call are armless if the address is not meant to be converted
extern void _nvram;
extern void _install_parameters;
extern void _envram;

#if defined(ST31)

void *pic(void *link_address)
{
// check if in the LINKED TEXT zone
if (link_address >= &_nvram && link_address < &_install_parameters) {
if (link_address >= &_nvram && link_address < &_envram) {
link_address = pic_internal(link_address);
}

Expand All @@ -45,7 +45,7 @@ void *pic(void *link_address)

// check if in the LINKED TEXT zone
__asm volatile("ldr %0, =_nvram" : "=r"(n));
__asm volatile("ldr %0, =_install_parameters" : "=r"(en));
__asm volatile("ldr %0, =_envram" : "=r"(en));
if (link_address >= n && link_address <= en) {
link_address = pic_internal(link_address);
}
Expand Down

0 comments on commit 09dce6e

Please sign in to comment.