[PATCH] D55311: Add support for OUTPUT_ARCH linker script command

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 5 15:18:08 PST 2018


ruiu added a comment.

Looks like what you are trying to do is to generate a x86-64 executable from i386 object files. That's what we do not expect in lld. With this patch, in theory you can create AArch64 exectuables from x86-64 object files, but that doesn't make sense and likely to crash the linker because we assume that all object files are uniform in terms of target types.

I think this use case is too tricky to directly support in the linker. I'd probably use objcopy or something to transplant i386 code to x86-64 object file before passing it to the linker, so that we don't deal with the trickiness in the linker.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55311/new/

https://reviews.llvm.org/D55311





More information about the llvm-commits mailing list