<div dir="ltr">I implemented the feature as --warn-backrefs in <a href="https://reviews.llvm.org/rL329636">https://reviews.llvm.org/rL329636</a>.<br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Apr 5, 2018 at 10:57 AM Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>On Thu, Apr 5, 2018 at 10:51 AM James Y Knight <<a href="mailto:jyknight@google.com" target="_blank">jyknight@google.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Apr 5, 2018 at 12:20 PM Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Apr 4, 2018 at 7:30 PM James Y Knight <<a href="mailto:jyknight@google.com" target="_blank">jyknight@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I believe this will report an error on more command-lines than a traditional linker would fail to link. E.g.:<div>  ld.lld foo.o A.a B.a A.a B.a</div><div>That "should" work fine if the libs are circularly-dependent, as long as there's only a 1-level cycle. I've seen that sort of construct used a fair amount, and while the start-group/end-group flags are pretty clearly a superior option, but are not universally used.</div></div></blockquote><div><br></div><div>Actually it won't report an error for that command line. We (and perhaps other linkers as well) don't do anything special for files that happen to be passed to a linker more than once, so the first A.a and second A.a are handled as different files.</div></div></div></blockquote><div><br></div><div>But if B.a requires pulling in an object from A.a, LLD will pull it from the _first_ A.a on the command-line, and then, if this flag is specified, report an error due to the incorrect ordering of dependencies. (Whereas GNU ld will pull it from the _second_ A.a and succeed linking.)</div></div></div></blockquote><div> </div><div>Ahh, that's true. I don't think that's a serious issue, but that's indeed something that this feature would report as a false positive.</div></div></div></blockquote></div>