[PATCH] D39000: [ELF] - Implement --orphan-handling option.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 07:29:16 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: ELF/LinkerScript.cpp:461-464
+  if (Config->OrphanHandling == OrphanHandlingPolicy::Warn)
+    warn(toString(IS) + " is being placed in '" + Name + "'");
+  else if (Config->OrphanHandling == OrphanHandlingPolicy::Error)
+    error(toString(IS) + " is being placed in '" + Name + "'");
----------------
nit: it is more natural if you swap the positions of warn and error.


================
Comment at: test/ELF/linkerscript/orphan-report.s:46-48
+# RUN: not ld.lld --orphan-handling=discard -o %t.out --script %t.script %t.o 2>&1 \
+# RUN:   | FileCheck %s --check-prefix=UNKNOWN
+# UNKNOWN: unknown --orphan-handling mode: discard
----------------
In general, when you give a bogus value, you should give a value that is obviously bogus, because it conveys your meaning better. Instead of "discard", pass "foo", for example. This comment applies to other patches.


https://reviews.llvm.org/D39000





More information about the llvm-commits mailing list