From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Unreachable code in mkimagexx (Fwd: New Defects reported by Coverity Scan for GRUB)
Date: Sun, 13 Mar 2016 10:38:17 +0300 [thread overview]
Message-ID: <56E518E9.3010304@gmail.com> (raw)
In-Reply-To: <56e50bb23d7a8_5d6aabd33094490@ss1435.mail>
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));
next parent reply other threads:[~2016-03-13 7:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <56e50bb23d7a8_5d6aabd33094490@ss1435.mail>
2016-03-13 7:38 ` Andrei Borzenkov [this message]
2016-03-14 7:01 ` Unreachable code in mkimagexx (Fwd: New Defects reported by Coverity Scan for GRUB) Andrei Borzenkov
2017-01-24 1:51 ` Vladimir 'phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56E518E9.3010304@gmail.com \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.