Make 0-series device specs work with older versions of avr-gcc.
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 20 Nov 2019 08:19:44 +0000 (08:19 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Wed, 20 Nov 2019 08:19:44 +0000 (08:19 +0000)
PR target/92545
* config/avr/specs.h (LINK_SPEC) <%(link_pm_base_address)>: Remove.
* config/avr/gen-avr-mmcu-specs.c (print_mcu)
<*link_pm_base_address>: Don't write spec.
<*link_arch>: Add --defsym=__RODATA_PM_OFFSET__= as needed.

From-SVN: r278478

gcc/ChangeLog
gcc/config/avr/gen-avr-mmcu-specs.c
gcc/config/avr/specs.h

index c2c82d354a0ad126a98f36b32aa5b249280fe823..a83391416b36ce6e7f7aeece7e7eb7886a59097f 100644 (file)
@@ -1,3 +1,13 @@
+2019-11-20  Georg-Johann Lay  <avr@gjlay.de>
+
+       Make 0-series device specs work with older versions of avr-gcc.
+
+       PR target/92545
+       * config/avr/specs.h (LINK_SPEC) <%(link_pm_base_address)>: Remove.
+       * config/avr/gen-avr-mmcu-specs.c (print_mcu)
+       <*link_pm_base_address>: Don't write spec.
+       <*link_arch>: Add --defsym=__RODATA_PM_OFFSET__= as needed.
+
 2019-11-20  Richard Biener  <rguenther@suse.de>
 
        PR c/92088
index f629db4e8a26600376e9048466ce2b1b0d510bab..363d7034626331c5c15185c6cd2d49725f00a2a3 100644 (file)
@@ -253,7 +253,11 @@ print_mcu (const avr_mcu_t *mcu)
 
   fprintf (f, "*link_relax:\n\t%s\n\n", LINK_RELAX_SPEC);
 
-  fprintf (f, "*link_arch:\n\t%s\n\n", LINK_ARCH_SPEC);
+  fprintf (f, "*link_arch:\n\t%s", LINK_ARCH_SPEC);
+  if (is_device
+      && flash_pm_offset)
+    fprintf (f, " --defsym=__RODATA_PM_OFFSET__=0x%x", flash_pm_offset);
+  fprintf (f, "\n\n");
 
   if (is_device)
     {
@@ -270,14 +274,6 @@ print_mcu (const avr_mcu_t *mcu)
       fprintf (f, "\n\n");
     }
 
-  if (is_device
-      && flash_pm_offset)
-    {
-      fprintf (f, "*link_pm_base_address:\n");
-      fprintf (f, "\t--defsym=__RODATA_PM_OFFSET__=0x%x", flash_pm_offset);
-      fprintf (f, "\n\n");
-    }
-
   // Specs known to GCC.
 
   if (is_device)
index b6fe4c8f64ff318fbc83c24b7c64e169a7344ddf..736ff621e84146fc27cff82446952c222e853a2b 100644 (file)
@@ -68,7 +68,6 @@ along with GCC; see the file COPYING3.  If not see
   "%(link_text_start) "                         \
   "%(link_relax) "                              \
   "%(link_pmem_wrap) "                          \
-  "%(link_pm_base_address) "                    \
   "%{shared:%eshared is not supported} "
 
 #undef  LIB_SPEC