public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marvin Häuser" <mhaeuser@posteo.de>
To: "Ni, Ray" <ray.ni@intel.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	Ard Biesheuvel <ardb@kernel.org>, Andrew Fish <afish@apple.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Liu, Zhiguang" <zhiguang.liu@intel.com>,
	Rebecca Cran <rebecca@bsdio.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [edk2-devel] [RFT PATCH v3 0/5] UefiCpuPkg, OvmfPkg: Simplify CpuExceptionHandlerLib
Date: Fri, 31 Mar 2023 14:42:55 +0000	[thread overview]
Message-ID: <0DD346A3-80BD-4489-B5BA-102B3E55179F@posteo.de> (raw)
In-Reply-To: <MN6PR11MB8244B18B3A64DFE2AE93C42E8C8F9@MN6PR11MB8244.namprd11.prod.outlook.com>

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


> On 31. Mar 2023, at 16:39, Ni, Ray <ray.ni@intel.com> wrote:
> 
> 
> 
>> -----Original Message-----
>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marvin
>> Häuser
>> Sent: Friday, March 31, 2023 7:10 PM
>> To: Ard Biesheuvel <ardb@kernel.org>
>> Cc: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io; Andrew Fish
>> <afish@apple.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Liu,
>> Zhiguang <zhiguang.liu@intel.com>; Rebecca Cran <rebecca@bsdio.com>;
>> Tom Lendacky <thomas.lendacky@amd.com>
>> Subject: Re: [edk2-devel] [RFT PATCH v3 0/5] UefiCpuPkg, OvmfPkg: Simplify
>> CpuExceptionHandlerLib
>> 
>> 
>>> On 31. Mar 2023, at 13:03, Ard Biesheuvel <ardb@kernel.org> wrote:
>>> 
>>> On Fri, 31 Mar 2023 at 12:41, Marvin Häuser <mhaeuser@posteo.de> wrote:
>>>> 
>>>> Hi Ray,
>>>> 
>>>>>> On 31. Mar 2023, at 12:09, Ni, Ray <ray.ni@intel.com> wrote:
>>>>> 
>>>>> Ard,
>>>>> What does "-read_only_relocs suppress" control?
>>>> 
>>>> It controls whether relocs that target read-only segments yield a build
>> error or not. I think lld uses “-z notext”.
>>>> 
>>>>> Linker doesn't produce relocation entries that modifies .text section
>> silently
>>>>> so the final .text just cannot run at all?
>>>> 
>>>> Could you please rephrase? I’m not sure I understand, but I think it’s
>> important everyone understands the issues at play to make a good judgment
>> call.
>>>> 
>>> 
>>> As *I* understood it, it means suppress the *warning* not suppress the
>>> *relocation*
> 
> What the meaning of "suppress relocation"?

The option naming is just a bit odd, it suppresses the warning about relocations to read-only segments, not the relocations themselves.

> Why the final binaries are not executable?

I explained that here: https://edk2.groups.io/g/devel/message/102219

TL;dr: Relocations are relative to the first writable segment (thus usually __DATA), so relocations to preceding segments (usually __TEXT) will underflow and thus get corrupted offsets.

Best regards,
Marvin

> 
>> 
>> Correct.
>> 
>>> 
>>> But the resulting binaries are broken, so it doesn't really matter.
>> 
>> 
>> 
>> 
>> 
> 


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

      reply	other threads:[~2023-03-31 14:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  9:14 [RFT PATCH v3 0/5] UefiCpuPkg, OvmfPkg: Simplify CpuExceptionHandlerLib Ard Biesheuvel
2023-03-31  9:14 ` [RFT PATCH v3 1/5] BaseTools/tools_def CLANGDWARF: Permit text relocations Ard Biesheuvel
2023-03-31  9:14 ` [RFT PATCH v3 2/5] UefiCpuPkg/CpuExceptionHandlerLib: Use single SEC/PEI version Ard Biesheuvel
2023-03-31  9:56   ` Ni, Ray
2023-03-31 10:12     ` [edk2-devel] " Ard Biesheuvel
2023-03-31 10:19       ` Ni, Ray
2023-03-31 10:49         ` Ard Biesheuvel
     [not found]   ` <17517877FE72B326.27612@groups.io>
2023-03-31  9:58     ` Ni, Ray
2023-03-31 10:14       ` Ard Biesheuvel
2023-03-31 10:16         ` Ni, Ray
2023-03-31 10:19           ` Ard Biesheuvel
2023-03-31  9:14 ` [RFT PATCH v3 3/5] UefiCpuPkg/CpuExceptionHandlerLib: Make runtime fixups XCODE-only Ard Biesheuvel
2023-03-31 10:03   ` [edk2-devel] " Ni, Ray
2023-03-31 10:20   ` Ni, Ray
2023-03-31  9:14 ` [RFT PATCH v3 4/5] OvmfPkg: Drop special Xcode5 version of exception handler library Ard Biesheuvel
2023-03-31  9:14 ` [RFT PATCH v3 5/5] UefiCpuPkg/CpuExceptionHandlerLib: Drop special XCODE5 version Ard Biesheuvel
2023-03-31 10:08 ` [edk2-devel] [RFT PATCH v3 0/5] UefiCpuPkg, OvmfPkg: Simplify CpuExceptionHandlerLib Ni, Ray
2023-03-31 10:15   ` Ard Biesheuvel
2023-03-31 10:41   ` Marvin Häuser
2023-03-31 11:03     ` Ard Biesheuvel
2023-03-31 11:09       ` Marvin Häuser
2023-03-31 14:39         ` Ni, Ray
2023-03-31 14:42           ` Marvin Häuser [this message]

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=0DD346A3-80BD-4489-B5BA-102B3E55179F@posteo.de \
    --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