From 09dce6e4990f85b671ddb6c160b6e1dadec3dc01 Mon Sep 17 00:00:00 2001 From: Xavier Chapron Date: Fri, 24 Nov 2023 18:26:36 +0100 Subject: [PATCH] src/pic.c: Restore PIC functionnality on all linked text zone Following previous commit, this now included the install_parameters that are added during the build process. (cherry picked from commit 2a823e5e7c0fa4223384fc5aea36a72149aaa743) --- src/pic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pic.c b/src/pic.c index 8bfb56cd2..aee063083 100644 --- a/src/pic.c +++ b/src/pic.c @@ -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); } @@ -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); }