]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c6x.c (c6x_section_type): Clear SECTION_NOTYPE for the ".far" section.
authorJeff Law <law@redhat.com>
Fri, 12 Jul 2019 15:40:39 +0000 (09:40 -0600)
committerJeff Law <law@gcc.gnu.org>
Fri, 12 Jul 2019 15:40:39 +0000 (09:40 -0600)
* config/c6x/c6x.c (c6x_section_type): Clear SECTION_NOTYPE
for the ".far" section.

From-SVN: r273447

gcc/ChangeLog
gcc/config/c6x/c6x.c

index 84fee9e0dd94fb24879618212a1134bef120f683..4f32256c8d83375017b59ce76e70fe8896386974 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-12  Jeff Law  <law@redhat.com>
+
+       * config/c6x/c6x.c (c6x_section_type): Clear SECTION_NOTYPE
+       for the ".far" section.
+
 2019-07-12  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/91145
index 93841e4abeffe02019f45841f583dea78ad99484..f6c9bbfc674fe7513869601989eecbafad6db0e1 100644 (file)
@@ -1083,6 +1083,14 @@ c6x_section_type_flags (tree decl, const char *name, int reloc)
 
   flags |= default_section_type_flags (decl, name, reloc);
 
+  /* The ".far" section will be declared with @nobits elsewhere.
+     But when declared via this path it will not have the @nobits
+     flag because of SECTION_NOTYPE.  This causes linker warnings
+     due to the mismatched attribute.  Clearing SECTION_NOTYPE
+     for the ".far" section is sufficient to fix this problem.  */
+  if (strcmp (name, ".far") == 0)
+    flags &= ~SECTION_NOTYPE;
+
   return flags;
 }
 \f