All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] efi_loader: handling of global data in *.efi files
@ 2018-10-13 10:40 Heinrich Schuchardt
  2018-10-16 13:23 ` Alexander Graf
  2018-10-19  3:25 ` Simon Glass
  0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2018-10-13 10:40 UTC (permalink / raw)
  To: u-boot

Hello Alex, hello Simon,

in arch/arm/lib/elf_aarch64_efi.lds we merge the .bss section into the
.data section with a comment by Simon:

"The EFI loader doesn't seem to like a .bss section, so we stick it into
.data".

Real live EFI binaries like iPXE's snp.efi have a .bss section:

Number of Sections 6
Section[0] .text
Section[1] .rodata
Section[2] .data
Section[3] .bss
Section[4] .reloc
Section[5] .debug

Do you remember what the exact problem was with .bss sections?

.bss sections have to be initialized after relocation. I could not find
any code relating to this in efi_image_loader.c. Did I miss it?

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] efi_loader: handling of global data in *.efi files
  2018-10-13 10:40 [U-Boot] efi_loader: handling of global data in *.efi files Heinrich Schuchardt
@ 2018-10-16 13:23 ` Alexander Graf
  2018-10-19  3:25 ` Simon Glass
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2018-10-16 13:23 UTC (permalink / raw)
  To: u-boot



On 13.10.18 12:40, Heinrich Schuchardt wrote:
> Hello Alex, hello Simon,
> 
> in arch/arm/lib/elf_aarch64_efi.lds we merge the .bss section into the
> .data section with a comment by Simon:
> 
> "The EFI loader doesn't seem to like a .bss section, so we stick it into
> .data".
> 
> Real live EFI binaries like iPXE's snp.efi have a .bss section:
> 
> Number of Sections 6
> Section[0] .text
> Section[1] .rodata
> Section[2] .data
> Section[3] .bss
> Section[4] .reloc
> Section[5] .debug
> 
> Do you remember what the exact problem was with .bss sections?
> 
> .bss sections have to be initialized after relocation. I could not find
> any code relating to this in efi_image_loader.c. Did I miss it?

.bss usually gets initialized by crt0 which is part of the target .efi
binary. Maybe our efi crt0 is missing .bss initialization?


Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] efi_loader: handling of global data in *.efi files
  2018-10-13 10:40 [U-Boot] efi_loader: handling of global data in *.efi files Heinrich Schuchardt
  2018-10-16 13:23 ` Alexander Graf
@ 2018-10-19  3:25 ` Simon Glass
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2018-10-19  3:25 UTC (permalink / raw)
  To: u-boot

Hi Heinrich,

On 13 October 2018 at 04:40, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> Hello Alex, hello Simon,
>
> in arch/arm/lib/elf_aarch64_efi.lds we merge the .bss section into the
> .data section with a comment by Simon:
>
> "The EFI loader doesn't seem to like a .bss section, so we stick it into
> .data".
>
> Real live EFI binaries like iPXE's snp.efi have a .bss section:
>
> Number of Sections 6
> Section[0] .text
> Section[1] .rodata
> Section[2] .data
> Section[3] .bss
> Section[4] .reloc
> Section[5] .debug
>
> Do you remember what the exact problem was with .bss sections?

No I don't - possible a link error?

>
> .bss sections have to be initialized after relocation. I could not find
> any code relating to this in efi_image_loader.c. Did I miss it?

Hmm seems like an omission.

Regards,
Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-19  3:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-13 10:40 [U-Boot] efi_loader: handling of global data in *.efi files Heinrich Schuchardt
2018-10-16 13:23 ` Alexander Graf
2018-10-19  3:25 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.