Skip to content

Commit

Permalink
chore: mark some segments as READONLY
Browse files Browse the repository at this point in the history
Prevent LOAD segment with RWX permissions warning.
The "READONLY" keyword is only supported in GCC11 and later,
remove it if using GCC10 or earlier.

Fixes #2475.

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Aug 20, 2024
1 parent fda9286 commit cf9f0ac
Show file tree
Hide file tree
Showing 261 changed files with 1,327 additions and 1,325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -108,7 +108,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -118,7 +118,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32C0xx/C031C(4-6)(T-U)/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -100,7 +100,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -110,7 +110,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32F0xx/F030C6T/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -108,7 +108,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -118,7 +118,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32F0xx/F030C8T/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -100,7 +100,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -110,7 +110,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32F0xx/F030F4P/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -100,7 +100,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -110,7 +110,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32F0xx/F030K6T/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -108,7 +108,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -118,7 +118,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32F0xx/F030R8T/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -100,7 +100,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -110,7 +110,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32F0xx/F031C(4-6)T/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -108,7 +108,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -118,7 +118,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
10 changes: 5 additions & 5 deletions variants/STM32F0xx/F031E6Y_F038E6Y/ldscript.ld
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.ARM.extab : {
.ARM.extab (READONLY) : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
.ARM (READONLY) : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
.preinit_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
Expand All @@ -108,7 +108,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.init_array :
.init_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
Expand All @@ -118,7 +118,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH

.fini_array :
.fini_array (READONLY) :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
Loading

0 comments on commit cf9f0ac

Please sign in to comment.