From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by sourceware.org (Postfix) with ESMTPS id 1260B386F401 for ; Thu, 24 Sep 2020 14:14:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1260B386F401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x344.google.com with SMTP id s13so3676796wmh.4 for ; Thu, 24 Sep 2020 07:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=lMz/Tkh30k3/Z+E3jSbWGTPAg5wW8w096Olk7PRou/8=; b=heMr+gjvA6+V9OGOFZ/88OgUUiLOf8zZt4IRrFtjbx2s21SbUQ17j1qBDmjeacFZoR pHP3LnC+tZHtttVZ3k4VF+xgQ6gk0MkRPosznMxFCOi8YJmWPbvUWs2LHCaB3PKoDyy4 oTGemD0YnbaXi6rI6keIHoggI+5oIUUFqESZZF93hZ5r4ySUPBF6wS0x1A81dDxySz5R R5MvVv0w4ryDO8CVqNRJPLv8bPMVecCNciSqO0BnnWB94oZYRTrazZLZ6YGyS1Dh+NGZ ohVerIjW5O7/PEbmFwxuAhY54JeNI2q2VXidR+lvKbwtj9vwbTa8ncjBHxw2z83ezwpg Si2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=lMz/Tkh30k3/Z+E3jSbWGTPAg5wW8w096Olk7PRou/8=; b=rDv24NNCeSjc5o+2fVYQwBGgQ2pm9agvwYpzlyYAPVPR08JM9UHB/VZn347ZR0TkQc zdRSqJcxrDhGeJd2WMGObwWbOHty7U1x6l4MN82JXU+6+fa5DQF4Jt9zKGN2S6LSMf6V d2Ts8FhGLF7dPq8FaRdzI5r5S32bj/sBU2RUP8E5f9BXLS4hFYhGGgsUtjJtNmFGElBE GPPPqF2H4D4cu1LI2H2kliPecwy92DLdxFg7IyMl1lw3IV1r41xh33nI4kKC3v+GktX6 w2JJTpegydKEyio04XrgLOF+dGWAukNYuexDQ44jrzWep8JYcQl6oicFziJTdK3fhxqH x4Xw== X-Gm-Message-State: AOAM533gHykEaHZgFkoQscXnrf4GENRogbbqDk7+zVl5/8JJyGD8H5JW DWZXEeK6dGOiMHVzMENfU5NOjR8iSZuiXr6S X-Google-Smtp-Source: ABdhPJz7E0ago8aAG3pookiHZah2Tr+db6N/mP9A8lcJUE0ZtGdrM2VmFoODs3bFEuv7e0ilba/V4A== X-Received: by 2002:a1c:2e08:: with SMTP id u8mr5323569wmu.156.1600956876029; Thu, 24 Sep 2020 07:14:36 -0700 (PDT) Received: from localhost (host31-53-80-104.range31-53.btcentralplus.com. [31.53.80.104]) by smtp.gmail.com with ESMTPSA id n66sm3644514wmb.35.2020.09.24.07.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 07:14:34 -0700 (PDT) Date: Thu, 24 Sep 2020 15:14:33 +0100 From: Andrew Burgess To: Cooper Qu Cc: binutils@sourceware.org, lifang_xia@c-sky.com, Simon Marchi Subject: [PUSHED] Re: [PATCH] CSKY: Add objdump option -M abi-names. Message-ID: <20200924141433.GA1540867@embecosm.com> References: <20200917063028.74459-1-cooper.qu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20200917063028.74459-1-cooper.qu@linux.alibaba.com> X-Operating-System: Linux/5.8.9-101.fc31.x86_64 (x86_64) X-Uptime: 15:09:49 up 5 days, 22:17, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Thu, 24 Sep 2020 14:14:38 -0000 I pushed the patch below under the "obvious" rule. I inspected the code and concluded that either the strcat should be included in the if body or the buf would be undefined, in which case the original patch has other issues. Thanks, Andrew --- commit 7b6addc226a004622a12c87d3292176dbc8da041 Author: Andrew Burgess Date: Thu Sep 24 15:03:43 2020 +0100 csky/opcodes: enclose if body in curly braces =20 This commit: =20 commit afdcafe89118cee761f9bf67ea1b1efc29311300 Date: Thu Sep 17 14:30:28 2020 +0800 =20 CSKY: Add objdump option -M abi-names. =20 cases the build of GDB (configured with --enabled-targets=3Dall) to fail with this error: =20 libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src/opcodes -I. -I= =2E./../src/opcodes -I../bfd -I../../src/opcodes/../include -I../../src/opc= odes/../bfd -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wst= ack-usage=3D262144 -Werror -O0 -g3 -D_GLIBCXX_DEBUG=3D1 -MT csky-dis.lo -MD= -MP -MF .deps/csky-dis.Tpo -c ../../src/opcodes/csky-dis.c -o csky-dis.o ../../src/opcodes/csky-dis.c: In function =E2=80=98csky_output_operan= d=E2=80=99: ../../src/opcodes/csky-dis.c:849:7: error: this =E2=80=98if=E2=80=99 = clause does not guard... [-Werror=3Dmisleading-indentation] 849 | if (IS_CSKY_V1 (mach_flag)) | ^~ ../../src/opcodes/csky-dis.c:851:2: note: ...this statement, but the = latter is misleadingly indented as if it were guarded by the =E2=80=98if=E2= =80=99 851 | strcat (str, buf); | ^~~~~~ =20 this commit adds { ... } around the if body to resolve this issue. =20 opcodes/ChangeLog: =20 * csky-dis.c (csky_output_operand): Enclose body of if in curly braces. diff --git a/opcodes/csky-dis.c b/opcodes/csky-dis.c index 67fb4ee87ed..ce20f58c473 100644 --- a/opcodes/csky-dis.c +++ b/opcodes/csky-dis.c @@ -847,8 +847,10 @@ csky_output_operand (char *str, struct operand const *= oprnd, } case OPRND_TYPE_REGr4_r7: if (IS_CSKY_V1 (mach_flag)) - sprintf (buf, "%s-%s", get_gr_name (4), get_gr_name (7)); - strcat (str, buf); + { + sprintf (buf, "%s-%s", get_gr_name (4), get_gr_name (7)); + strcat (str, buf); + } break; case OPRND_TYPE_CONST1: strcat (str, "1");