From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1af0bb-00083L-Ec for mharc-grub-devel@gnu.org; Sun, 13 Mar 2016 03:38:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af0bY-00082x-Ez for grub-devel@gnu.org; Sun, 13 Mar 2016 03:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1af0bV-00045w-8S for grub-devel@gnu.org; Sun, 13 Mar 2016 03:38:24 -0400 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:33875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af0bU-00045p-Ri for grub-devel@gnu.org; Sun, 13 Mar 2016 03:38:21 -0400 Received: by mail-lb0-x232.google.com with SMTP id xr8so197955214lbb.1 for ; Sat, 12 Mar 2016 23:38:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:to:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=jIA6xd0Us48CKtgx5nMmpQmwtlZk9sMBnj9uDwCZoM4=; b=Ne5NgFIGXFsbaLPtBIV1cIbR442k1awYNZocnkPRB9F31CWKMGS1XROSknJckL4LBW 6bJSuN8qXjj19RoXxX3prLHIkmS+SGcHssnV3OKTuf3REtM0F8YXaidfMyugVWctV0Th cujNl6SJ4ehfp4ZHcNCjk+j6MEgremz0FHoCjfpuo46tNOplaCpaqW9VbmYZWwhJKcdL EEzPPP8M878M4NAUWVzpq2LbrW5i2RaaGdvCDMKUiD2RfTLDb3km8x5vSfgAC8LKIdk2 GCM7kYuQGz5z9zSdTowwd8lTd6PTDR0XECmXJ/AUpvwQyL7jeJk6RmCq+sV2gkGt+Y2P vnHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jIA6xd0Us48CKtgx5nMmpQmwtlZk9sMBnj9uDwCZoM4=; b=TGKZTKYYIv3m0fCzUJTY7//zgUfNmEIiVu4O88+zBRIEn38DQOB/CsJXfyUywmi8jp Un+iGAMG6jSQHHuh3810tbHTP7AuUPTFeIoHky6onB1ZN71OB0LiwSzwx5FbaTqYVmHF 0ooGXsfZju821jCD+YiHQJ6DaWatUKXY4Z6U4KSEI7vajkKlNBzq/R07454rh+t75I5R 86PZp2wG0eeEEahrDEFNG8120FDlwTEZoupVLq2J3N3x3pWce1P8FFKkeXmK9T2H03DS JEsLAHdER/Tkg5/PiAqD21vnbzcjLHVw2+gZcYNubIdQY42KczDzGCmFl7OtlTKen7xv G0FQ== X-Gm-Message-State: AD7BkJKC5KeGlrZdLPj2qUUn2TD+0TF5WPNVy3Cp037TnssbdBkT98jUdagFcTkcUJo57Q== X-Received: by 10.25.32.4 with SMTP id g4mr6483964lfg.14.1457854699739; Sat, 12 Mar 2016 23:38:19 -0800 (PST) Received: from [192.168.1.42] (ppp109-252-76-159.pppoe.spdop.ru. [109.252.76.159]) by smtp.gmail.com with ESMTPSA id v140sm2715609lfd.24.2016.03.12.23.38.18 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Mar 2016 23:38:18 -0800 (PST) Subject: Unreachable code in mkimagexx (Fwd: New Defects reported by Coverity Scan for GRUB) References: <56e50bb23d7a8_5d6aabd33094490@ss1435.mail> To: The development of GNU GRUB From: Andrei Borzenkov X-Forwarded-Message-Id: <56e50bb23d7a8_5d6aabd33094490@ss1435.mail> Message-ID: <56E518E9.3010304@gmail.com> Date: Sun, 13 Mar 2016 10:38:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56e50bb23d7a8_5d6aabd33094490@ss1435.mail> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 07:38:25 -0000 We probably need to #ifdef this section for MKIMAGE_ELF64 case only, it makes no sense to compile it for 32 bit target. ________________________________________________________________________________________________________ *** CID 158599: (DEADCODE) /util/grub-mkimagexx.c: 1317 in translate_relocation_pe() 1311 break; 1312 } 1313 break; 1314 case EM_AARCH64: 1315 switch (ELF_R_TYPE (info)) 1316 { >>> CID 158599: (DEADCODE) >>> Execution cannot reach this statement: "case 257U:". 1317 case R_AARCH64_ABS64: 1318 { 1319 ctx->current_address 1320 = add_fixup_entry (&ctx->lst, 1321 GRUB_PE32_REL_BASED_DIR64, 1322 addr, 0, ctx->current_address, /util/grub-mkimagexx.c: 1331 in translate_relocation_pe() 1325 break; 1326 /* Relative relocations do not require fixup entries. */ 1327 case R_AARCH64_CALL26: 1328 case R_AARCH64_JUMP26: 1329 break; 1330 /* Page-relative relocations do not require fixup entries. */ >>> CID 158599: (DEADCODE) >>> Execution cannot reach this statement: "case 275U:". 1331 case R_AARCH64_ADR_PREL_PG_HI21: 1332 /* We page-align the whole kernel, so no need 1333 for fixup entries. 1334 */ 1335 case R_AARCH64_ADD_ABS_LO12_NC: 1336 case R_AARCH64_LDST64_ABS_LO12_NC: /util/grub-mkimagexx.c: 1335 in translate_relocation_pe() 1329 break; 1330 /* Page-relative relocations do not require fixup entries. */ 1331 case R_AARCH64_ADR_PREL_PG_HI21: 1332 /* We page-align the whole kernel, so no need 1333 for fixup entries. 1334 */ >>> CID 158599: (DEADCODE) >>> Execution cannot reach this statement: "case 277U:". 1335 case R_AARCH64_ADD_ABS_LO12_NC: 1336 case R_AARCH64_LDST64_ABS_LO12_NC: 1337 break; 1338 1339 default: 1340 grub_util_error (_("relocation 0x%x is not implemented yet"), /util/grub-mkimagexx.c: 1328 in translate_relocation_pe() 1322 addr, 0, ctx->current_address, 1323 image_target); 1324 } 1325 break; 1326 /* Relative relocations do not require fixup entries. */ 1327 case R_AARCH64_CALL26: >>> CID 158599: (DEADCODE) >>> Execution cannot reach this statement: "case 282U:". 1328 case R_AARCH64_JUMP26: 1329 break; 1330 /* Page-relative relocations do not require fixup entries. */ 1331 case R_AARCH64_ADR_PREL_PG_HI21: 1332 /* We page-align the whole kernel, so no need 1333 for fixup entries. /util/grub-mkimagexx.c: 1327 in translate_relocation_pe() 1321 GRUB_PE32_REL_BASED_DIR64, 1322 addr, 0, ctx->current_address, 1323 image_target); 1324 } 1325 break; 1326 /* Relative relocations do not require fixup entries. */ >>> CID 158599: (DEADCODE) >>> Execution cannot reach this statement: "case 283U:". 1327 case R_AARCH64_CALL26: 1328 case R_AARCH64_JUMP26: 1329 break; 1330 /* Page-relative relocations do not require fixup entries. */ 1331 case R_AARCH64_ADR_PREL_PG_HI21: 1332 /* We page-align the whole kernel, so no need /util/grub-mkimagexx.c: 1336 in translate_relocation_pe() 1330 /* Page-relative relocations do not require fixup entries. */ 1331 case R_AARCH64_ADR_PREL_PG_HI21: 1332 /* We page-align the whole kernel, so no need 1333 for fixup entries. 1334 */ 1335 case R_AARCH64_ADD_ABS_LO12_NC: >>> CID 158599: (DEADCODE) >>> Execution cannot reach this statement: "case 286U:". 1336 case R_AARCH64_LDST64_ABS_LO12_NC: 1337 break; 1338 1339 default: 1340 grub_util_error (_("relocation 0x%x is not implemented yet"), 1341 (unsigned int) ELF_R_TYPE (info));