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

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 5 12:57:20 PST 2018


void added a comment.

In D55311#1319943 <https://reviews.llvm.org/D55311#1319943>, @grimar wrote:

> What is your use case? I wonder what is the reason to use `OUTPUT_ARCH` to **override** `-m`?


It was pointed out that the "-m" flag has slightly different semantics than what we would expect:

>From Ian Taylor:

"The documentation for the option says:

  -m emulation
      Emulate the emulation linker. You can list the available emulations with the ‘--verbose’ or ‘-V’ options.
      If the ‘-m’ option is not used, the emulation is taken from the LDEMULATION environment variable, if that is defined.
      Otherwise, the default emulation depends upon how the linker was configured.

"The point is that the emulation does not primarily set the expected object file format.  It sets the default linker behavior.  With the BFD linker, it primarily sets the linker script to use (the BFD linker always uses a linker script).  If you then provide a different linker script using the -T option, that naturally overrides the linker script selected by the -m option."


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