qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [edk2-devel] On integrating LoongArch EDK2 firmware into QEMU build


From: Chao Li
Subject: Re: [edk2-devel] On integrating LoongArch EDK2 firmware into QEMU build process
Date: Tue, 4 Apr 2023 10:24:22 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1

在 2023/4/3 19:04, Gerd Hoffmann 写道:

On Mon, Apr 03, 2023 at 10:29:52AM +0000, Michael Brown wrote:
On 03/04/2023 11:13, Chao Li wrote:
This problem is because the gcc-12 does not yet to support the option
'mno-explicit-reloc', this option is used to open the new reloaction
type for LoongArch, this new feature is very important for LoongArch,
because it can reduce the binary size and improve code execution
efficiency, so we turn it on when submitting the code to the EDK2 repo.
Is it possible to produce a _functional_ LoongArch64 EDK2 binary without
this option, even if the resulting binary is less efficient?
MdePkg/Include/IndustryStandard/PeImage.h lists a single loongarch
relocation type only, which I expect being the new type.  So I suspect
the answer is "no" because the edk2 pe loader isn't able to handle the
old relocation type(s).

Yes, the answer is "no", but the opposite is ture, the MdePkg/Include/IndustryStandard/PeImage.h LoongArch relocation type is older, this type appears in this list for compatiblility with binaries using the old reloaction type. If you use this type, you have to turn on the option '-mla-global-with-abs' in gcc, all global symbols will be created as "mark la" type, PE loader will use this rule to handle them. This option is mutually exclusive with 'mno-explicit-reloc',  new reloaction type(s) doesn't require special type(s) to be expressed in PeImage.h, PE loader doesn't need to do anything about relocation, all of reloaction process is done in BaseTools/Source/C/GenFw/Elf64Convert.c.


Thanks,
Chao
在 2023/4/3 19:04, Gerd Hoffmann 写道:
On Mon, Apr 03, 2023 at 10:29:52AM +0000, Michael Brown wrote:
On 03/04/2023 11:13, Chao Li wrote:
This problem is because the gcc-12 does not yet to support the option
'mno-explicit-reloc', this option is used to open the new reloaction
type for LoongArch, this new feature is very important for LoongArch,
because it can reduce the binary size and improve code execution
efficiency, so we turn it on when submitting the code to the EDK2 repo.
Is it possible to produce a _functional_ LoongArch64 EDK2 binary without
this option, even if the resulting binary is less efficient?
MdePkg/Include/IndustryStandard/PeImage.h lists a single loongarch
relocation type only, which I expect being the new type.  So I suspect
the answer is "no" because the edk2 pe loader isn't able to handle the
old relocation type(s).

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102384): https://edk2.groups.io/g/devel/message/102384
Mute This Topic: https://groups.io/mt/98030924/6496846
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [lichao@loongson.cn]
-=-=-=-=-=-=-=-=-=-=-=-


reply via email to

[Prev in Thread] Current Thread [Next in Thread]