Page MenuHomeFreeBSD

sys/tools/amd64_ia32_vdso.sh: Pass explicit -m to ld for ld.bfd.
AbandonedPublic

Authored by jhb on Feb 2 2022, 8:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 14 2024, 4:12 PM
Unknown Object (File)
Feb 21 2024, 1:09 AM
Unknown Object (File)
Dec 20 2023, 5:44 AM
Unknown Object (File)
Dec 3 2023, 2:05 PM
Unknown Object (File)
Aug 29 2023, 3:20 AM
Unknown Object (File)
Aug 7 2023, 1:23 AM
Unknown Object (File)
May 29 2023, 3:36 AM
Unknown Object (File)
May 6 2023, 12:27 AM
Subscribers

Details

Reviewers
kib
emaste
Summary

Unlike lld, ld.bfd does not intuit the default emulation from the
input files.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44250
Build 41138: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Feb 2 2022, 8:20 PM

IMO it is worth explicitly specify the emulation for amd64 64bit too.

BTW it is strange, I put OUTPUT_ARCH() into the ldscript. Might be, what is needed is OUTPUT_FORMAT() there as well, and then it is better than '-m', IMO.

I put my attempt at D34157. Still I believe I tested with ld.bfd.

Actually, if we don't want to use -m with LD, then I'd rather use CC as the linker instead. gcc -m32 will DTRT and pass the right -m to ld. clang will pass it if needed as well.

In D34143#772700, @jhb wrote:

Actually, if we don't want to use -m with LD, then I'd rather use CC as the linker instead. gcc -m32 will DTRT and pass the right -m to ld. clang will pass it if needed as well.

It required passing nostdlib, some magic to avoid linking crt*, and so on. This is why I went with direct ld invocation.

It is really not about passing or not -m, but putting as much setup as possible into linker script.