summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-11-24 11:17:01 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2024-01-25 08:15:12 +0100
commit8e77e113bae78292aaba21f2325e123e40b2072a (patch)
treebc66a53e124350da22a720896eb932dbc8da3404
parenttrace/wscript: Improve C++ standard selection (diff)
downloadrtems-tools-8e77e113bae78292aaba21f2325e123e40b2072a.tar.bz2
linkers: Use push/pop section
Restore the previous section, otherwise the generated code may end up in a wrong section.
-rw-r--r--linkers/rtems-syms.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/linkers/rtems-syms.cpp b/linkers/rtems-syms.cpp
index 88ee970..f0ac2bb 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
};