From patchwork Mon Feb 10 14:07:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1235837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-519231-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=XA3BgvFx; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JI4I2+xQ; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48GSRs5w6Sz9sSj for ; Tue, 11 Feb 2020 01:08:24 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=E+j6KyWpEQZ4QOXV EPwFT2KVu3tnk53P7gZZNKizr3zVayB57eS7bg8BYwMG20fnQ0rLsmlwCYgO1VGc sZ9Vh2jO7s26eH06IIiCMsvy+AmSSuksNfesJNbexr5vUn9rTZkC1lQnDzsqRQHl BQ8Ka8mBh5HfF7lCum2wfi/YoaU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type :content-transfer-encoding; s=default; bh=5qEbYt+qw6kXQF0aSPv5mO R9Q+Y=; b=XA3BgvFxHF/LqApfZ+wy6MSr+fgSmQ591Q9yJtyosvS0cY4dq6Rwlg 9/kErwWtsZgiGIyPV8eA2xP/D0HgVMCC6Gtez14xICF0IvQUrYOeTawSEFLc9ofb l1OCwrC8Un+h8Zg4bDNZ9TfFOkCB38Y3RSuzlZPPykdU4aTYo5TS0= Received: (qmail 94474 invoked by alias); 10 Feb 2020 14:08:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 94462 invoked by uid 89); 10 Feb 2020 14:08:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=UD:i386.c.jj, i386.c.jj, i386cjj X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Feb 2020 14:08:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581343693; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JTRtFe3ZCKpi4ui3Xaylo8O6qQPftSj7CayO6gv05qs=; b=JI4I2+xQQRrqbXv7vw91IEZhbjqeV5P8KfcfMk+psFukLF2u8yojMbT0VSwU1SmsNR7G7q SD4d4Bm1uOD/Cq9XhITh0SqNE8S0mwWD/DU9I8ByTtZ/Kpus4C8XWMa+mfrdAJj2SI7Rwx jTs0UdwTBOUPI4TsTxKxwFFkd9i3uW8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-X3Cu6enaOve97y9m17I9ZQ-1; Mon, 10 Feb 2020 09:07:53 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 963BCDB62 for ; Mon, 10 Feb 2020 14:07:52 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 414895DA82 for ; Mon, 10 Feb 2020 14:07:52 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 01AE7otW004602 for ; Mon, 10 Feb 2020 15:07:50 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 01AE7nVg004601 for gcc-patches@gcc.gnu.org; Mon, 10 Feb 2020 15:07:49 +0100 Date: Mon, 10 Feb 2020 15:07:49 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] i386: Fix strncmp last arguments in x86_64_elf_section_type_flags [PR93641] Message-ID: <20200210140749.GN17695@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 User-Agent: Mutt/1.11.3 (2019-02-01) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-IsSubscribed: yes 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 PR target/58218 PR other/93641 * config/i386/i386.c (x86_64_elf_section_type_flags): Fix up last arguments of strncmp. Jakub --- 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;