From patchwork Tue Nov 1 11:18:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 13628 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2892647wru; Tue, 1 Nov 2022 04:18:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Zkz39CEea6o6JPNNOMPR6rOU/2FlAKE7T1NY5qxUn2P3ik20SgIoM2q1QsGzHx33oVA7h X-Received: by 2002:aa7:d9d1:0:b0:461:9556:23e6 with SMTP id v17-20020aa7d9d1000000b00461955623e6mr19320398eds.25.1667301500171; Tue, 01 Nov 2022 04:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667301500; cv=none; d=google.com; s=arc-20160816; b=HG7P+vHtBwDGx/m4oo06jTNrRnSmQemsCyd3VHdR4Zaf6PTNWy8ywZIWBjtajJMveC 2DDVgBR/znpLGi/DuNwQ5A7bQtV/XtH3ukA71Xc+VA5fF91y3+hR6Q0EqfX/mn9hbSDo RShJ6gAvFO8jEjwR3dbQbzjBlclvfbW49yT+rryFXRmxmgbj6IZ2NKSxjgXv/D1cNASP Ry74E6WPDnivk02bGCCy9xcbVV0qOOlrutIs+ub+Waq3YiHZ20WIVGTHMjbZO82oKrmt rwyu8PSo/2ir+8UxA2jrbkZPjnqnUfePACbiXXWuxnLil3tvO6GiHrtnCsWWK5ud3Cma daBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=AIP/ymnHO0fh646DPr7QIyrJfxC1O49yprFLOlF97Ko=; b=P51EejPzqj/+H2OvKhTzZmxQzGuPnv5I1K1YSMD6KeU0rJ13G+8mpMljspjvF4Te/J aKmMzlobvZxraJZXwvTnT+nQ2BWVPkWc4nfZBlN3mKB2rJul4jRUeIfk5o3UBHJQ6H9i sdsrQBQb3fmz/AFsdPsPlPphZYwRA29MBWtikoxVgzigivUOdlQlYl+41WfV+1F3wQuu 8h74jJl0EHk94BtWJiI0eibgELaArMwDGztkch6IefzCMNApT5Ct3IPGb8WepF+NS2AA BCBkrRVMi6XmgXO1RK+3CNIe+ZQVqrT3C2aOrHFvp/SLdGwoW8x4IaP5q72xAye8izMG DmCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="gMwE/h/r"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id jg16-20020a170907971000b00781dbeebeb1si12085276ejc.585.2022.11.01.04.18.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 04:18:20 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="gMwE/h/r"; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EFA4A3858006 for ; Tue, 1 Nov 2022 11:18:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFA4A3858006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667301499; bh=AIP/ymnHO0fh646DPr7QIyrJfxC1O49yprFLOlF97Ko=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gMwE/h/rQL/LsLpW/PSSnAZoTOhL4YmRwtLPc+v9pKbuyEE+J6BYWgnCi7ZOmqoH5 AE6jGcLR8kfoYKNKhKUcLohQ43/n6rwa/z65Nu7hl7h8dSEw1zh4jSTPcPTl5TNV1/ JvSInagxfNfeqDouo0h26eCL4CR9uHCHVX3djTuw= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2D0283858C1F for ; Tue, 1 Nov 2022 11:18:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D0283858C1F Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-226-m50bh8JxM-Kv3wdbJ33-Rg-1; Tue, 01 Nov 2022 07:18:09 -0400 X-MC-Unique: m50bh8JxM-Kv3wdbJ33-Rg-1 Received: by mail-qt1-f198.google.com with SMTP id 17-20020ac85711000000b0039ccd4c9a37so9680824qtw.20 for ; Tue, 01 Nov 2022 04:18:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AIP/ymnHO0fh646DPr7QIyrJfxC1O49yprFLOlF97Ko=; b=0HZpe9xITXkiZ5DzUB7M7i1I8/gsPTtAJrgLZ35emNhnMlCNjvYOATpmw5hKdoLSBe tJVPjfrhrGDlS5iJ8xcp0HU5B1447pOorUDWyfhQ+Y4KzOMPb/7L/lZ8xVbsFtuPwT/j ZNsagzz/p3nFB3IrQVjpGA8YtHn8csgK/nezyYfGF1iBMqIhfEEeFiLNElWSyHLjEHNk 4hR2gK5bPhIdlSsaCDdOASq/znb62q2PGlmu/hEupKbuSYkj/DRZ21oZ7wL8cj+3VIoe PSBNd1I14cbR7xZy6jt5xPHweQRWTrgIi1Tdw+knj/CmgmlgadsRjsfsaaV5qH+f3K4M T9Ug== X-Gm-Message-State: ACrzQf1QZXEQ8LxTwCSxpIjC+4NQU9m64ynhGK2H9w9XPWx05dvB9giI +fbsQxm3GI7CJLBzD4FB71dVweB24UL//CFn+qoTQBusCgoxzpeOu+iQZahj9F2YWRkpMjulddq JrW0q2VXHpRbMEME5Ei7rucLyzhY5SIAP4KJ0LMh8wqKOmoMEecvjRZ6rj72OMoTtXM1paw== X-Received: by 2002:a05:622a:11d0:b0:39d:322:7c38 with SMTP id n16-20020a05622a11d000b0039d03227c38mr14318566qtk.291.1667301488453; Tue, 01 Nov 2022 04:18:08 -0700 (PDT) X-Received: by 2002:a05:622a:11d0:b0:39d:322:7c38 with SMTP id n16-20020a05622a11d000b0039d03227c38mr14318549qtk.291.1667301488151; Tue, 01 Nov 2022 04:18:08 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id j8-20020a05620a410800b006fa313bf185sm3161317qko.8.2022.11.01.04.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 04:18:07 -0700 (PDT) To: binutils@sourceware.org Subject: [PUSHED] opcodes/arm: don't pass non-string literal to printf like function Date: Tue, 1 Nov 2022 11:18:02 +0000 Message-Id: <20221101111802.1532080-1-aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20221101105724.1527333-1-aburgess@redhat.com> References: <20221101105724.1527333-1-aburgess@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Binutils From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748292337567070767?= X-GMAIL-MSGID: =?utf-8?q?1748292337567070767?= To my great shame. After fixing the previous issue, yet another problem showed up on a couple of the buildbots (but not all, I'm guessing due to compiler version differences). Again, I've pushed the fix for this issue. I don't think there will be any disagreement for this fix, but do let me know if there is and I'm happy to provide an adjustment. Once again, sorry for the breakage, Andrew --- The earlier commit: commit 6576bffe6cbbb53c5756b2fccd2593ba69b74cdf Date: Thu Jul 7 13:43:45 2022 +0100 opcodes/arm: add disassembler styling for arm introduced two places where a register name was passed as the format string to the disassembler's fprintf_styled_func callback. This will cause a warning from some compilers, like this: ../../binutils-gdb/opcodes/arm-dis.c: In function ‘print_mve_vld_str_addr’: ../../binutils-gdb/opcodes/arm-dis.c:6005:3: error: format not a string literal and no format arguments [-Werror=format-security] 6005 | func (stream, dis_style_register, arm_regnames[gpr]); | ^~~~ This commit fixes these by using "%s" as the format string. --- opcodes/arm-dis.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 101b3f84dfe..31ed81f5a4e 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -6002,7 +6002,7 @@ print_mve_vld_str_addr (struct disassemble_info *info, add_sub = "-"; func (stream, dis_style_text, "["); - func (stream, dis_style_register, arm_regnames[gpr]); + func (stream, dis_style_register, "%s", arm_regnames[gpr]); if (p == 1) { func (stream, dis_style_text, ", "); @@ -8588,7 +8588,8 @@ print_insn_coprocessor_1 (const struct sopcode32 *opcodes, is_unpredictable = true; u_reg = value; } - func (stream, dis_style_register, arm_regnames[value]); + func (stream, dis_style_register, "%s", + arm_regnames[value]); break; case 'V': if (given & (1 << 6))