From a099423f4ac177823dda741e2d9e5f4368d1f289 Mon Sep 17 00:00:00 2001 From: bebbo Date: Thu, 6 Apr 2023 16:48:53 +0200 Subject: [PATCH] refs #196: force new section directives for all chip/fast/far data sections --- .cproject | 16 ++-------------- gcc/config/m68k/amigaos.c | 15 +++++++++++---- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.cproject b/.cproject index 45b4524c7a8..be9895bc2d9 100755 --- a/.cproject +++ b/.cproject @@ -89,22 +89,10 @@ - + - - - - - - - - - - - - - + diff --git a/gcc/config/m68k/amigaos.c b/gcc/config/m68k/amigaos.c index 015887c6b37..abea4e69df3 100755 --- a/gcc/config/m68k/amigaos.c +++ b/gcc/config/m68k/amigaos.c @@ -302,11 +302,18 @@ amiga_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED, tree if (0 == strncmp (".text.startup", name, 13) || 0 == strncmp (".text.exit", name, 10)) name = ".text"; - if (0 == strncmp(".data", name, 5) && (!DECL_INITIAL (decl) || initializer_zerop (DECL_INITIAL (decl)))) + if (0 == strncmp(".data", name, 5)) { - extern section * in_section; - fprintf (asm_out_file, "\t.section .bss%s\n", name + 5); - in_section = NULL; + if (!DECL_INITIAL (decl) || initializer_zerop (DECL_INITIAL (decl))) + { + extern section * in_section; + fprintf (asm_out_file, "\t.section .bss%s\n", name + 5); + } + else + fprintf (asm_out_file, "\t.section %s\n", name); + + if (strstr(name, "chip") || strstr(name, "fast") || strstr(name, "far")) + in_section = NULL; } // else if (0 == strncmp(".section ", name, 8) || 0 == strncmp(".text", name, 5) || 0 == strncmp(".data", name, 5) || 0 == strncmp(".bss", name, 4)) // fprintf (asm_out_file, "\t%s\n", name);