[PATCH] D44214: Improve --warn-symbol-ordering.

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 09:02:02 PDT 2018


espindola accepted this revision.
espindola added inline comments.


================
Comment at: lld/ELF/Writer.cpp:1063
+      auto *Sec = dyn_cast_or_null<InputSectionBase>(cast<Defined>(Sym)->Section);
+      if (!Sec) {
+        Warning("unable to order absolute symbol");
----------------
jhenderson wrote:
> espindola wrote:
> > ruiu wrote:
> > > jhenderson wrote:
> > > > espindola wrote:
> > > > > This will now fire on symbols the linker defines relative to an output section, no?
> > > > > 
> > > > That would be a good thing, right? Attempting to order a symbol not associated with an OutputSection (whether linker-defined or not) would be impossible.
> > > Yeah, I think this is a desired behavior.
> > Warning would be good, calling it an absolute symbol in the warning is the issue.
> Ah, I see what you mean. Perhaps update the message to "absolute or linker-defined symbol"?
> 
> This wouldn't be strictly true, since if the linker were to define an input section-relative symbol it could reorder it (do we ever do this?), but should be clear enough.
True. I was thinking about having two different messages, but just rewording is sufficient.

LGTM with the error updated.


https://reviews.llvm.org/D44214





More information about the llvm-commits mailing list