public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] i386: Fix strncmp last arguments in x86_64_elf_section_type_flags [PR93641]
@ 2020-02-10 14:08 Jakub Jelinek
  2020-02-10 18:00 ` Segher Boessenkool
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2020-02-10 14:08 UTC (permalink / raw)
  To: gcc-patches

Hi!

Clearly I can't count, so we would consider as SECTION_BSS even sections
like .lbssfoo or .gnu.linkonce.lbbar, even when linker only considers as
special .lbss or .lbss.baz or .gnu.linkonce.lb.qux.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk as obvious.

2020-02-10  Jakub Jelinek  <jakub@redhat.com>

	PR target/58218
	PR other/93641
	* config/i386/i386.c (x86_64_elf_section_type_flags): Fix up last
	arguments of strncmp.

--- gcc/config/i386/i386.c.jj	2020-02-07 19:11:57.378982855 +0100
+++ gcc/config/i386/i386.c	2020-02-10 09:24:18.247860282 +0100
@@ -751,8 +751,9 @@ x86_64_elf_section_type_flags (tree decl
     flags |= SECTION_RELRO;
 
   if (strcmp (name, ".lbss") == 0
-      || strncmp (name, ".lbss.", 5) == 0
-      || strncmp (name, ".gnu.linkonce.lb.", 16) == 0)
+      || strncmp (name, ".lbss.", sizeof (".lbss.") - 1) == 0
+      || strncmp (name, ".gnu.linkonce.lb.",
+		  sizeof (".gnu.linkonce.lb.") - 1) == 0)
     flags |= SECTION_BSS;
 
   return flags;

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-11  2:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 14:08 [committed] i386: Fix strncmp last arguments in x86_64_elf_section_type_flags [PR93641] Jakub Jelinek
2020-02-10 18:00 ` Segher Boessenkool
2020-02-10 18:08   ` Jakub Jelinek
2020-02-11  2:33     ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).