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)
Nov 22 2024, 4:11 PM
Unknown Object (File)
Nov 16 2024, 10:51 AM
Unknown Object (File)
Sep 29 2024, 6:58 AM
Unknown Object (File)
Sep 18 2024, 10:39 AM
Unknown Object (File)
Sep 16 2024, 12:56 PM
Unknown Object (File)
Sep 15 2024, 10:37 PM
Unknown Object (File)
Sep 13 2024, 12:09 PM
Unknown Object (File)
Sep 11 2024, 4:55 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.