public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] MicrovmX64, "Did not find any '.text' section"
@ 2024-10-10 15:52 Leif Lindholm
  2024-11-01  9:55 ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Leif Lindholm @ 2024-10-10 15:52 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Gerd Hoffmann

Hi Gerd, others,

While working on the FdtLib migration to the submodule variant, I 
decided to at least try to test build MicrovmX64 ... but I'm failing.

Both clang and gcc builds bail out at a GenFw invocation to generate 
ResetVector.efi due to "Did not find any '.text' section". (Assert on 
line 938 of Elf64Convert.c.)
OvmfPkgX64 builds without issue.

Is there something I'm missing?
Can anyone else build MicrovmX64 on current HEAD?

/
     Leif



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120615): https://edk2.groups.io/g/devel/message/120615
Mute This Topic: https://groups.io/mt/108931674/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] MicrovmX64, "Did not find any '.text' section"
  2024-10-10 15:52 [edk2-devel] MicrovmX64, "Did not find any '.text' section" Leif Lindholm
@ 2024-11-01  9:55 ` Gerd Hoffmann
  2024-11-04 21:17   ` Oliver Smith-Denny
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2024-11-01  9:55 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: devel@edk2.groups.io

On Thu, Oct 10, 2024 at 04:52:48PM +0100, Leif Lindholm wrote:
> Hi Gerd, others,
> 
> While working on the FdtLib migration to the submodule variant, I decided to
> at least try to test build MicrovmX64 ... but I'm failing.
> 
> Both clang and gcc builds bail out at a GenFw invocation to generate
> ResetVector.efi due to "Did not find any '.text' section". (Assert on line
> 938 of Elf64Convert.c.)
> OvmfPkgX64 builds without issue.
> 
> Is there something I'm missing?
> Can anyone else build MicrovmX64 on current HEAD?

Works for me (Fedora 40, gcc 14.2.1).
Using in-tree C BaseTools.

The microvm build creates an
Build/MicrovmX64/DEBUG_GCC5/X64/OvmfPkg/ResetVector/ResetVector/DEBUG/ResetVector.dll
file which had no .text section indeed.

The OvmfPkgX64 build doesn't even though both use the same
ResetVector.inf.  Hmm, not sure why, but it's probably related.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120700): https://edk2.groups.io/g/devel/message/120700
Mute This Topic: https://groups.io/mt/108931674/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] MicrovmX64, "Did not find any '.text' section"
  2024-11-01  9:55 ` Gerd Hoffmann
@ 2024-11-04 21:17   ` Oliver Smith-Denny
  2024-11-06 11:41     ` Leif Lindholm via groups.io
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Smith-Denny @ 2024-11-04 21:17 UTC (permalink / raw)
  To: devel, kraxel, Leif Lindholm

On 11/1/2024 2:55 AM, Gerd Hoffmann wrote:
> On Thu, Oct 10, 2024 at 04:52:48PM +0100, Leif Lindholm wrote:
>> Hi Gerd, others,
>>
>> While working on the FdtLib migration to the submodule variant, I decided to
>> at least try to test build MicrovmX64 ... but I'm failing.
>>
>> Both clang and gcc builds bail out at a GenFw invocation to generate
>> ResetVector.efi due to "Did not find any '.text' section". (Assert on line
>> 938 of Elf64Convert.c.)

So I was hitting this also when doing dynamic stack cookies and trying
different ways to make ResetVector be okay being linked to the
null stack cookie lib. There is something that BaseTools doesn't do well
when ResetVector is linked against libraries, are you adding a library
linkage here (say a NULL lib applied globally)?

To fix this for stack cookies, my PR converts ResetVector to be
USER_DEFINED so that BaseTools will not link NULL libs against it.

Worth a shot seeing if making that change (you need to change the
RESETVECTOR rule in the FDF from SEC to USER_DEFINED also) makes
a difference. If this is not being caused by a null library
linkage, then I have no idea what is happening :).

Oliver




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120713): https://edk2.groups.io/g/devel/message/120713
Mute This Topic: https://groups.io/mt/108931674/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] MicrovmX64, "Did not find any '.text' section"
  2024-11-04 21:17   ` Oliver Smith-Denny
@ 2024-11-06 11:41     ` Leif Lindholm via groups.io
  2024-11-06 16:32       ` Oliver Smith-Denny
  0 siblings, 1 reply; 5+ messages in thread
From: Leif Lindholm via groups.io @ 2024-11-06 11:41 UTC (permalink / raw)
  To: devel, osde; +Cc: kraxel, Leif Lindholm

Hi Oliver, Gerd,

On Mon, 4 Nov 2024 at 21:17, Oliver Smith-Denny
<osde@linux.microsoft.com> wrote:
> >> While working on the FdtLib migration to the submodule variant, I decided to
> >> at least try to test build MicrovmX64 ... but I'm failing.
> >>
> >> Both clang and gcc builds bail out at a GenFw invocation to generate
> >> ResetVector.efi due to "Did not find any '.text' section". (Assert on line
> >> 938 of Elf64Convert.c.)
>
> So I was hitting this also when doing dynamic stack cookies and trying
> different ways to make ResetVector be okay being linked to the
> null stack cookie lib. There is something that BaseTools doesn't do well
> when ResetVector is linked against libraries, are you adding a library
> linkage here (say a NULL lib applied globally)?

No, I mean I'm building current edk2 HEAD unmodified, with current
in-tree BaseTools.
With GCC 14.2.0 using GCC profile, and clang 16.0.2 using CLANGDWARF profile.
(On Debian "testing".)

> To fix this for stack cookies, my PR converts ResetVector to be
> USER_DEFINED so that BaseTools will not link NULL libs against it.
>
> Worth a shot seeing if making that change (you need to change the
> RESETVECTOR rule in the FDF from SEC to USER_DEFINED also) makes
> a difference. If this is not being caused by a null library
> linkage, then I have no idea what is happening :).

I can confirm the above workaround fixes the build for both toolchain profiles.
Thanks a lot, that means I can get back to verifying my actual changes :)

Best Regards,

Leif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120739): https://edk2.groups.io/g/devel/message/120739
Mute This Topic: https://groups.io/mt/108931674/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] MicrovmX64, "Did not find any '.text' section"
  2024-11-06 11:41     ` Leif Lindholm via groups.io
@ 2024-11-06 16:32       ` Oliver Smith-Denny
  0 siblings, 0 replies; 5+ messages in thread
From: Oliver Smith-Denny @ 2024-11-06 16:32 UTC (permalink / raw)
  To: devel, leif.lindholm; +Cc: kraxel, Leif Lindholm

On 11/6/2024 3:41 AM, Leif Lindholm via groups.io wrote:
> No, I mean I'm building current edk2 HEAD unmodified, with current
> in-tree BaseTools.
> With GCC 14.2.0 using GCC profile, and clang 16.0.2 using CLANGDWARF profile.
> (On Debian "testing".)
> 

Hmm, that is odd indeed.

>> To fix this for stack cookies, my PR converts ResetVector to be
>> USER_DEFINED so that BaseTools will not link NULL libs against it.
>>
>> Worth a shot seeing if making that change (you need to change the
>> RESETVECTOR rule in the FDF from SEC to USER_DEFINED also) makes
>> a difference. If this is not being caused by a null library
>> linkage, then I have no idea what is happening :).
> 
> I can confirm the above workaround fixes the build for both toolchain profiles.
> Thanks a lot, that means I can get back to verifying my actual changes :)
> 

Glad to hear it! If you want to review my PR where I change the type, it
is here: https://github.com/tianocore/edk2/pull/6381. It is a large PR
to bring in the dynamic stack cookies, too, I can split it into two if
desired (waiting to hear back from Mike Kinney on whether he wants it in
two).

Thanks,
Oliver



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120742): https://edk2.groups.io/g/devel/message/120742
Mute This Topic: https://groups.io/mt/108931674/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-06 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 15:52 [edk2-devel] MicrovmX64, "Did not find any '.text' section" Leif Lindholm
2024-11-01  9:55 ` Gerd Hoffmann
2024-11-04 21:17   ` Oliver Smith-Denny
2024-11-06 11:41     ` Leif Lindholm via groups.io
2024-11-06 16:32       ` Oliver Smith-Denny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox