]> git.ipfire.org Git - thirdparty/grub.git/commit
grub-mkimage: Only check aarch64 relocations when built for aarch64
authorDarren Kenny <darren.kenny@oracle.com>
Wed, 16 Mar 2022 17:25:04 +0000 (17:25 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 21 Mar 2022 18:34:08 +0000 (19:34 +0100)
commit8541f319cb840abae054f78757aeddb41b4711a6
tree1d5501541e96fe79aa095a0dfdf9e851552833fc
parentcd63a2f8cd2c14748f4374abcd9a38705f2e7055
grub-mkimage: Only check aarch64 relocations when built for aarch64

Coverity flagged the switch checks for R_AARCH64_* as being logically
dead code, since it could never happen on x86 due to the masking of the
values earlier in the code.

A check for building on __arm__ (which gcc and clang define) and for
MKIMAGE_ELF64 (which GRUB defines) has been added to avoid this dead
code being built in.

Fixes: CID 158599
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-mkimagexx.c