public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chao Li" <lichao@loongson.cn>
To: devel@edk2.groups.io, kraxel@redhat.com, mcb30@ipxe.org
Cc: maobibo@loongson.cn, "WANG Xuerui" <i.qemu@xen0n.name>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Song Gao" <gaosong@loongson.cn>, 杨小娟 <yangxiaojuan@loongson.cn>
Subject: Re: [edk2-devel] On integrating LoongArch EDK2 firmware into QEMU build process
Date: Tue, 4 Apr 2023 10:24:22 +0800	[thread overview]
Message-ID: <84a503cd-82a4-5509-9629-da93c9e3ba64@loongson.cn> (raw)
In-Reply-To: <wkju3vayu3e2wtqmxakigrliv7ifj4ecd7ympkgwlacf7h4ckx@jnkqqqujdycf>

[-- Attachment #1: Type: text/plain, Size: 2540 bytes --]

在 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
>
>
>
> 
>

[-- Attachment #2: Type: text/html, Size: 4046 bytes --]

  reply	other threads:[~2023-04-04  2:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1f1d3d9f-c3df-4f29-df66-886410994cc3@xen0n.name>
     [not found] ` <67517424-0f32-09f8-6446-53f71ebd59b5@loongson.cn>
     [not found]   ` <x5vbhjcyc3jl5u3qdjg2dq2znwhdq7ordmbjm6s2hftwyusqp2@r6smasorrjor>
     [not found]     ` <317e3008-e2bd-8af6-2cf5-dad49d98cb8d@loongson.cn>
2023-04-03  8:51       ` On integrating LoongArch EDK2 firmware into QEMU build process maobibo
2023-04-03 10:13         ` [edk2-devel] " Chao Li
2023-04-03 10:29           ` Michael Brown
2023-04-03 11:04             ` Gerd Hoffmann
2023-04-04  2:24               ` Chao Li [this message]
2023-04-03 10:58           ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84a503cd-82a4-5509-9629-da93c9e3ba64@loongson.cn \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox