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)
Thu, Nov 13, 1:54 AM
Unknown Object (File)
Sun, Nov 9, 7:48 PM
Unknown Object (File)
Sat, Nov 8, 3:42 AM
Unknown Object (File)
Oct 23 2025, 2:21 AM
Unknown Object (File)
Oct 14 2025, 8:16 PM
Unknown Object (File)
Oct 14 2025, 8:16 PM
Unknown Object (File)
Oct 14 2025, 10:08 AM
Unknown Object (File)
Oct 12 2025, 3:08 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.