Skip to contentSkip to conversation

lib: elf: Fix typo

PATCH In review Daniel Palmer 2 participants 3 messages Dec 16, 2025 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: elf: Fix typo

I guess someone had EFI on the mind when writing the comment and wrote EFI instead of ELF.

---
 lib/elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/elf.c +1 -1
index e767a42a3b3f..a92d0d30c666 100644
@@ -188,7 +188,7 @@ unsigned long load_elf64_image_shdr(unsigned long addr)
  * A very simple ELF loader, assumes the image is valid, returns the
  * entry point address.
  *
- * The loader firstly reads the EFI class to see if it's a 64-bit image.
+ * The loader firstly reads the ELF class to see if it's a 64-bit image.
  * If yes, call the ELF64 loader. Otherwise continue with the ELF32 loader.
  */
 unsigned long load_elf_image_phdr(unsigned long addr)
Signature · 1 line
2.51.0
#1 lore raw

Hi Daniel,

Quoted 5 lines · Daniel Palmer

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

I guess someone had EFI on the mind when writing the comment and wrote EFI instead of ELF.

Looking at the code, I believe it should be "EI" instead?

https://elixir.bootlin.com/u-boot/v2025.10/source/lib/elf.c#L201

Also please add the following trailer to your commit:

Fixes 839c4e9c5bb0 ("elf: Add a very simple ELF64 loader")

which should automatically Cc the author of the patch, here Bin Meng (added manually in Cc) who could tell us what it should actually be.

Cheers,
Quentin

#2 lore raw

Hi Quentin,

Quoted 2 lines · Quentin Schulz

Looking at the code, I believe it should be "EI" instead?

Yeah, I think you are right. The comment seems like it should really be above the if where the check is happening but I guess the intent is to show the function is ok for either 32 or 64 bit because it checks the class.