Skip to content
Snippets Groups Projects
Commit ae67dca5 authored by Alexander Graf's avatar Alexander Graf
Browse files

efi_loader: helloworld.c: Explicitly use .rodata for loaded_image_guid


Commit bbf75dd9 ("efi_loader: output load options in helloworld")
introduced a const variable in efi_main() called loaded_image_guid which
got populated from a constant struct.

While you would usually expect a compiler to realize that this variable
should really just be a global pointer to .rodata, gcc disagrees and instead
puts it on the stack. Unfortunately in some implementations of gcc it does
so my calling memcpy() which we do not implement in our hello world
environment.

So let's explicitly move it to a global variable which in turn puts it in
.rodata reliably and gets rid of the memcpy().

Fixes: bbf75dd9 ("efi_loader: output load options in helloworld")
Reported-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Reviewed-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
parent 15616a0a
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment