[PATCH] D60502: [llvm-nm] Add --special-syms

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 14:15:53 PDT 2019


jakehehrlich added a comment.

In D60502#1471512 <https://reviews.llvm.org/D60502#1471512>, @jhenderson wrote:

> In D60502#1471500 <https://reviews.llvm.org/D60502#1471500>, @rupprecht wrote:
>
> > Just to see if I understand the comments so far: `--special-syms` is essentially already the default for `llvm-nm` (i.e. we print special symbols), but not for GNU `nm`. And so even though we print special symbols, a configure script that checks if `$NM --special-syms` is supported will fail when it shouldn't.
> >
> > If so, then LGTM -- this patch makes things less worse in all regards.
>
>
> There's a counter-example to this though, which I'm concerned about. If we silently accept --special-syms, with it being the default always, there could be configure scripts that don't specify --special-syms that expect to NOT see those symbols (e.g. they're looking for all "normal" symbols). This in turn could result in a silent breakage.


Those people weren't using llvm-nm apparently so we won't break them. If they were they'd already be broken. I think this strictly increases compatibility. Either way we have to choose who to break. People who might use llvm-nm in the future in place of nm and have written their script in a very specific way such that it needs to have those symbols filtered out or people who are using this flag today and are 100% broken but the flag not existing.

The symlink option above would work as well and ensure that future users had a paved way forward. We seem to be hitting an increasing number of cases where "llvm-gnu-foo" tools might be useful. I think the solution to using the "--strip-all-gnu" issue in llvm-objcopy is exactly this as well.

This patch has my LGTM since I think this will only strictly improve active users. As James points out however this might break future users who switch over but I think on balance that's an unlikely subset.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60502/new/

https://reviews.llvm.org/D60502





More information about the llvm-commits mailing list