Hi
For our platform we use some ,across which should set/clear bit 28 of an address (see code below). We do this for convenience reasons. #define IFX_S_ADDRESS_ALIAS(x) ((x) | 0x10000000) #define IFX_NS_ADDRESS_ALIAS(x) ((x) & ~0x10000000)
Those macros are used in declaration of S_CODE_START macro. When expended in linker script (tfm_isolation_l3.o), the declaration of LR_CODE section looks as follows:
LR_CODE (0x24000000 | 0x10000000) (0x4B000) {
This code results in following error:
tfm_isolation_l3.o", line 46 (column 21): Error: L6292E: Ignoring unknown attribute '|' specified for region LR_CODE.
I tried experimenting with this and found out that when | is changed to or (see following code) then linker works fine:
LR_CODE (0x24000000 or 0x10000000) (0x4B000) {
Same problem is present when using bitwise and (&). But when using bitwise NOT (~0x...) everything works fine.
Having to define our macros in different way brings some problems for our platform, so maybe someone knows how to solve this problem? Maybe there are compilation flags or something like that? Ideally we want | and & to work fine in linker script.
Thanks!
Regards, Bohdan Hunko
Cypress Semiconductor Ukraine Engineer CSUKR CSS ICW SW FW Mobile: +38099 50 19 714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
Hi all,
Duplication message again in hope to find solution.
Regards, Bohdan Hunko
Cypress Semiconductor Ukraine Engineer CSUKR CSS ICW SW FW Mobile: +38099 50 19 714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
From: Bohdan.Hunko--- via TF-M tf-m@lists.trustedfirmware.org Sent: 26 May 2023 19:26 To: tf-m@lists.trustedfirmware.org Cc: Mazurak Roman (CSUKR CSS ICW SW FW 3) Roman.Mazurak@infineon.com; Kytsun Hennadiy (CSUKR CSS ICW SW FW 3) Hennadiy.Kytsun@infineon.com; Brand Chris (CSCA CSS ICW SW PSW 1) Chris.Brand@infineon.com Subject: [TF-M] Using bitwise or (|) / and (&) in Clang scatter file
Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx.
Hi
For our platform we use some ,across which should set/clear bit 28 of an address (see code below). We do this for convenience reasons. #define IFX_S_ADDRESS_ALIAS(x) ((x) | 0x10000000) #define IFX_NS_ADDRESS_ALIAS(x) ((x) & ~0x10000000)
Those macros are used in declaration of S_CODE_START macro. When expended in linker script (tfm_isolation_l3.o), the declaration of LR_CODE section looks as follows:
LR_CODE (0x24000000 | 0x10000000) (0x4B000) {
This code results in following error:
tfm_isolation_l3.o", line 46 (column 21): Error: L6292E: Ignoring unknown attribute '|' specified for region LR_CODE.
I tried experimenting with this and found out that when | is changed to or (see following code) then linker works fine:
LR_CODE (0x24000000 or 0x10000000) (0x4B000) {
Same problem is present when using bitwise and (&). But when using bitwise NOT (~0x...) everything works fine.
Having to define our macros in different way brings some problems for our platform, so maybe someone knows how to solve this problem? Maybe there are compilation flags or something like that? Ideally we want | and & to work fine in linker script.
Thanks!
Regards, Bohdan Hunko
Cypress Semiconductor Ukraine Engineer CSUKR CSS ICW SW FW Mobile: +38099 50 19 714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
I Bohdan,
As describes in armlink user guide, OR and AND supported in the scatter file: [cid:image001.png@01D99574.3539DDB0]
I checked with the armclang expert and got feedback that there are no link options to make armlinker support | or & in sct file.
Regards, Sherry Zhang
From: Bohdan.Hunko--- via TF-M tf-m@lists.trustedfirmware.org Sent: Thursday, June 1, 2023 8:24 PM To: tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: Using bitwise or (|) / and (&) in Clang scatter file
Hi all,
Duplication message again in hope to find solution.
Regards, Bohdan Hunko
Cypress Semiconductor Ukraine Engineer CSUKR CSS ICW SW FW Mobile: +38099 50 19 714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: 26 May 2023 19:26 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org Cc: Mazurak Roman (CSUKR CSS ICW SW FW 3) <Roman.Mazurak@infineon.commailto:Roman.Mazurak@infineon.com>; Kytsun Hennadiy (CSUKR CSS ICW SW FW 3) <Hennadiy.Kytsun@infineon.commailto:Hennadiy.Kytsun@infineon.com>; Brand Chris (CSCA CSS ICW SW PSW 1) <Chris.Brand@infineon.commailto:Chris.Brand@infineon.com> Subject: [TF-M] Using bitwise or (|) / and (&) in Clang scatter file
Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx.
Hi
For our platform we use some ,across which should set/clear bit 28 of an address (see code below). We do this for convenience reasons. #define IFX_S_ADDRESS_ALIAS(x) ((x) | 0x10000000) #define IFX_NS_ADDRESS_ALIAS(x) ((x) & ~0x10000000)
Those macros are used in declaration of S_CODE_START macro. When expended in linker script (tfm_isolation_l3.o), the declaration of LR_CODE section looks as follows:
LR_CODE (0x24000000 | 0x10000000) (0x4B000) {
This code results in following error:
tfm_isolation_l3.o", line 46 (column 21): Error: L6292E: Ignoring unknown attribute '|' specified for region LR_CODE.
I tried experimenting with this and found out that when | is changed to or (see following code) then linker works fine:
LR_CODE (0x24000000 or 0x10000000) (0x4B000) {
Same problem is present when using bitwise and (&). But when using bitwise NOT (~0x...) everything works fine.
Having to define our macros in different way brings some problems for our platform, so maybe someone knows how to solve this problem? Maybe there are compilation flags or something like that? Ideally we want | and & to work fine in linker script.
Thanks!
Regards, Bohdan Hunko
Cypress Semiconductor Ukraine Engineer CSUKR CSS ICW SW FW Mobile: +38099 50 19 714 Bohdan.Hunko@infineon.commailto:Bohdan.Hunko@infineon.com
tf-m@lists.trustedfirmware.org