[PATCH] D48153: Add TARGET(foo) linker script directive.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 14:31:22 PDT 2018


ruiu created this revision.
ruiu added reviewers: grimar, rdhindsa.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.

GNU ld's manual says that TARGET(foo) is basically an alias for
`--format foo` where foo is a BFD target name such as elf64-x86-64.

Unlike GNU linkers, lld doesn't allow arbitrary BFD target name for
--format. We accept only "default", "elf" or "binary". This makes
situation a bit tricky because we can't simply make TARGET an alias for
--target.

A quick code search revealed that the usage number of TARGET is very
small, and the only meaningful usage is to switch to the binary mode.
Thus, in this patch, we handle only TARGET(elf.*) and TARGET(binary).


https://reviews.llvm.org/D48153

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/Driver.h
  lld/ELF/ScriptParser.cpp
  lld/test/ELF/linkerscript/target.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48153.151250.patch
Type: text/x-patch
Size: 3351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180613/4f5a4b3b/attachment.bin>


More information about the llvm-commits mailing list