This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] MicroBlaze resolve section change issues for ident output


Change 'microblaze_asm_output_ident' so that instead of just switching
section to .sdata2/.rodata it uses the assembler .pushsection and
.popsection directives to preserve the section context when emitting the
ident string content.

This resolves issues associated with the use of the .sdata2/.rodata
operation in cases where emitted assembly after the ident output is
incorrectly in the .sdata2/.rodata section instead of .text or any other
expected section. This results in assembly failures including operations
with symbols across different segments.

gcc/ChangeLog

2018-01-11  Nathan Rossi  <nathan@nathanrossi.com>

        PR target/83013
        * config/microblaze/microblaze.c (microblaze_asm_output_ident):
        Use .pushsection/.popsection
---
 gcc/config/microblaze/microblaze.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index 51511ca2fc..9a4a287be2 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -3394,7 +3394,9 @@ microblaze_asm_output_ident (const char *string)
   else
     section_asm_op = READONLY_DATA_SECTION_ASM_OP;
 
-  buf = ACONCAT ((section_asm_op, "\n\t.ascii \"", string, "\\0\"\n", NULL));
+  buf = ACONCAT (("\t.pushsection", section_asm_op,
+                  "\n\t.ascii \"", string, "\\0\"\n",
+                  "\t.popsection\n", NULL));
   symtab->finalize_toplevel_asm (build_string (strlen (buf), buf));
 }
 
-- 
2.15.1



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]