Skip to content
Commit e4679489 authored by Alexander Graf's avatar Alexander Graf
Browse files

efi_loader: Convert runtime reset from switch to if statements



We currently handle the UEFI runtime reset / power off case handling via
a switch statement. Compilers (gcc in my case) may opt to handle these via
jump tables which they may conveniently put into .rodata which is not part
of the runtime section, so it will be unreachable when executed.

Fix this by just converting the switch statement into an if/else statement.
It produces smaller code that is faster and also correct because we no
longer refer .rodata from efi runtime code.

Reported-by: default avatarAndreas Färber <aferber@suse.de>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent de452c04
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment