[PATCH] D53495: Add OUTPUT_FORMAT linker script directive support.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 08:30:15 PDT 2018


ruiu added inline comments.


================
Comment at: lld/ELF/ScriptParser.cpp:410
+  if (Config->EKind == ELFNoneKind)
+    std::tie(Config->EKind, Config->EMachine) = BfdName;
+
----------------
grimar wrote:
> ruiu wrote:
> > grimar wrote:
> > > So I think this means LLD will error out when seeing the object file with incompatible architecture after parsing the script containing `OUTPUT_FORMAT`. Behavior is fine, but I think there is no test provided for that case?
> > I don't think we need that test case.
> Then you should be able to simplify to
> 
> `std::tie(Config->EKind, Config->EMachine) = readBfdName();`
I'm not too picky about aiming 100% test coverage, and I meant that we don't need a test case for that in that sense. I'll add a test for you but we don't need to test for all possible combinations of conditions.


https://reviews.llvm.org/D53495





More information about the llvm-commits mailing list