Skip to contentSkip to conversation

Sections .dynamic and .dynsym in UEFI binaries

DISCUSSION Heinrich Schuchardt 2 participants 2 messages Aug 29, 2020

lore
Share & tools
lore
#0 lore raw

Hello Simon,

with commit c7ae3dfdccc1 ("efi: Add support for a hello world test program") you added section .dynamic and .dynsym to generated UEFI binaries.

It is unclear to me why those sections should be needed. According to
https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-42444.html
section .dynamic is only used for dynamic linking.

On RISC-V inclusion of .dynsym leeds to a file that is longer then the value of SizeOfImage in the optional header.

On x86 and x86_64 we have a general problem that SizeOfImage does not match the actual file size.

Best regards

Heinrich

#1 lore raw

Hi Heinrich,

Quoted 10 lines · Heinrich Schuchardt

Hello Simon,

with commit c7ae3dfdccc1 ("efi: Add support for a hello world test program") you added section .dynamic and .dynsym to generated UEFI binaries.

It is unclear to me why those sections should be needed. According to
https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-42444.html
section .dynamic is only used for dynamic linking.

Quoted 5 lines

On RISC-V inclusion of .dynsym leeds to a file that is longer then the value of SizeOfImage in the optional header.

On x86 and x86_64 we have a general problem that SizeOfImage does not match the actual file size.

I think this was brought over from arch/x86/config.mk

If it still works without it then it is OK to drop those two sections.

Regards,
Simon