Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM UKI #24

Open
joylatten opened this issue Aug 21, 2023 · 0 comments
Open

ARM UKI #24

joylatten opened this issue Aug 21, 2023 · 0 comments

Comments

@joylatten
Copy link
Collaborator

Problem: shim produces a load_error when loading the arm uki.
Given: Used the latest gnu-efi instead of 3.0.13 (installed via apt-get) because 3.0.13 does not have dummy relocation section in the crt0-efi-aarch64.S which is needed to run an EFI executable in the EFI partition (i.e. when I ran it before it said something along the lines of "no relocation section found.)

Shim source seems to indicate the load error occurs when stepping through the relocation table created
by linker. Either the address of the relocation table was null or an entry (a section ?) in the
table had zero bytes. Perhaps adding more debug messages in that file may help.

Troubleshooting:

  1. It is possible that if the .dummy section has zero bytes in uki, it may be causing the shim to produce the
    load error. Perhaps it is possible the original relocation error was caused by something else. One possibility, is in
    most recent upstream shim source that .note.GNU-stack section was added to each arch's
    crt0-efi-*.S file to ensure shim.efi will contain it. The commit comment, rhboot/gnu-efi@1972ead,
    "In binutils-2.39, GNU ld has decided it can no longer link objects that
    don't have a .note.GNU-stack section, and thus has broken anything
    linking against gnu-efi."

Perhaps when using binutils-3.0.13, linker wanted this section? I would think
that gcc would include this section if it was required by linker. It might be something to check
and consider. I am not sure would just the uki require this section if it even requires it,
or do executable elf files put into a section of efi also require this section in an env with newer binutils?

Some possible references for additional info:
https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments
https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart#
https://refspecs.linuxbase.org/elf/gabi4+/ch5.dynamic.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant