[RTEMS Tools] linkers: Use push/pop section

Chris Johns chrisj at rtems.org
Sun Jan 21 23:25:32 UTC 2024


Looks good

Thanks
Chris

On 16/1/2024 5:44 pm, Sebastian Huber wrote:
> Restore the previous section, otherwise the generated code may end up in
> a wrong section.
> ---
>  linkers/rtems-syms.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/linkers/rtems-syms.cpp b/linkers/rtems-syms.cpp
> index 699c014..ecdcd15 100644
> --- a/linkers/rtems-syms.cpp
> +++ b/linkers/rtems-syms.cpp
> @@ -77,7 +77,7 @@ static const char* c_header[] =
>    "void rtems_rtl_base_sym_global_add (const unsigned char* , unsigned int,",
>    "                                    rtems_rtl_tls_offset*, size_t );",
>    "",
> -  "asm(\".section \\\".rodata\\\"\");",
> +  "asm(\".pushsection \\\".rodata\\\"\");",
>    "",
>    "asm(\"  .align   4\");",
>    "asm(\"  .local   rtems__rtl_base_globals\");",
> @@ -122,6 +122,7 @@ static const char* c_trailer[] =
>    "asm(\"  .local   rtems__rtl_base_globals_size\");",
>    "asm(\"rtems__rtl_base_globals_size:\");",
>    "asm(\"  .long rtems__rtl_base_globals_size - rtems__rtl_base_globals\");",
> +  "asm(\"  .popsection\");",
>    "",
>    0
>  };


More information about the devel mailing list