[PATCH] D42475: [ELF] Add warnings for various symbols that cannot be ordered

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 08:53:00 PST 2018


jhenderson added a comment.

In https://reviews.llvm.org/D42475#994397, @ruiu wrote:

> I noticed that all these error checks can be moved to the driver (which is a better place to show a warning message for bad user inputs) if you do like this: https://github.com/rui314/llvm-project/commit/301cf4915cf99b5270905ba823b3b56be327e3f8
>
> I just hacked it up, so I didn't test it, but I think this should work to describe the idea.


I like the principle of your idea, but unfortunately, there are two issues with it that I discovered (plus one easily fixed bug in the implementation for absolute symbols). Firstly, it is relying on the symbols in the final symbol table, which means, for example, that where there are local symbols requested to be ordered, a "symbol not found" warning will be emitted, whereas in the old behaviour, local symbols could be ordered. Secondly, since this location in the driver happens before processSectionCommands, there will be no warning for /DISCARD/-ed, which with the current proposal there is. It might be possible to work around the former, by changing the implementation to loop over symbols in the input files, as done currently, but it is not possible to solve the latter using this approach. I'd therefore prefer to keep the change in the current location.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42475





More information about the llvm-commits mailing list