]> git.baikalelectronics.ru Git - uboot.git/commit
efi_loader: helloworld.c: Explicitly use .rodata for loaded_image_guid
authorAlexander Graf <agraf@suse.de>
Mon, 11 Dec 2017 08:40:47 +0000 (09:40 +0100)
committerAlexander Graf <agraf@suse.de>
Sat, 16 Dec 2017 21:51:19 +0000 (22:51 +0100)
commited404816f6230e4c933b9e58b2e8f03f750fee54
tree50bacb3e058ce6d3ccaab3dc2eafab6286fbbd8e
parentd4921e925e7539bd8a1d7e9b7e77d72aff559631
efi_loader: helloworld.c: Explicitly use .rodata for loaded_image_guid

Commit f9635c9886d16c ("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: f9635c9886d16c ("efi_loader: output load options in helloworld")
Reported-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
lib/efi_loader/helloworld.c