[PATCH 3/7] Makefile.lib: Preserve .rodata section for EFI file

Jiaxun Yang jiaxun.yang at flygoat.com
Tue Jun 11 16:06:57 CEST 2024



在2024年6月11日六月 下午2:49,Ilias Apalodimas写道:
> Hi Jiaxun
>
>
> On Fri, 17 May 2024 at 19:33, Jiaxun Yang <jiaxun.yang at flygoat.com> wrote:
>>
>> This is required in performing objcopy to MIPS EFI files.
>>
>
> This seems not mips specific. What was missing for your case?

So MIPS EFI file would come with .rodata section. If we don't preserve
it here, the whole section would be stripped away.

.rodata is always necessary in binary if it's in ELF as it contains
valid program data.

Other architectures won't generate .rodata section in their ELF file
so it's harmless. Besides GNU-EFI's universal strip commands also have
-j .rodata argument.

Thanks
- Jiaxun
>
> Thanks
> /Ilias
>> Signed-off-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
>> ---
>>  scripts/Makefile.lib | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index 62f87517c09c..52aed7a65d47 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -469,7 +469,7 @@ $(obj)/%_efi.S: $(obj)/%.efi
>>
>>  quiet_cmd_efi_objcopy = OBJCOPY $@
>>  cmd_efi_objcopy = $(OBJCOPY) -j .header -j .text -j .sdata -j .data -j \
>> -               .dynamic -j .dynsym  -j .rel* -j .rela* -j .reloc \
>> +               .dynamic -j .dynsym  -j .rel* -j .rela* -j .reloc -j .rodata \
>>                 $(if $(EFI_TARGET),$(EFI_TARGET),-O binary) $^ $@
>>
>>  $(obj)/%.efi: $(obj)/%_efi.so
>>
>> --
>> 2.34.1
>>

-- 
- Jiaxun


More information about the U-Boot mailing list