[PATCH] D40558: [ELF] - Trigger error when -R <filename> is given.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 14:13:45 PST 2017


On Tue, Nov 28, 2017 at 2:07 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:
>
> > ruiu added a comment.
> >
> > If you are suggesting we emit something like "cannot open file for -R:
> foo/bar is a directory. Did you mean -rpath?" for -R, I think I'd agree
> that that is probably better than just emitting an error without the hint.
>
> Two options:
> * We alias -R to --just-symbols. In which case an error like what you
>   are suggesting is OK.
> * We alias -R to --rpath. In which case we would like an error like:
>   "foo/bar is not a directory. Do you want --just-symbols?".
>
> Given that --rpath is more common, I think we should keep -R aliased to
> --rpath and have the second error.
>

I think we shouldn't even emit an error for the second case. -rpath is the
information for the dynamic linker, and the static linker should blindly
store given -rpath paths to a file header, because the static linker
doesn't know the actual runtime environment. It is a valid use case that a
given -rpath is not a directory in a build environment but a directory in a
runtime environment.

Given that, I'm inclined to not to emit an error or a warning at all for -R
and just make it an alias to -rpath. If you are so familiar with linker
features that you want to use --just-symbols, you are likely to know -R,
-rpath and -just-symbols. -just-symbols is used very rarely, so in reality,
I think this is not an issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171128/177a8354/attachment.html>


More information about the llvm-commits mailing list