Control: tag -1 moreinfo

Hi!

On Mon, 2021-08-23 at 17:59:48 +0300, Raul Tambre wrote:
> Package: dpkg-dev
> Version: 1.20.9
> Severity: normal

> GNU ld generates a nullptr absolute symbol for each version script tag.
> test.sym:
> 
>     LIBTEST_1
>     {
>     };
> 
> clang -shared /dev/null -o example.so -Wl,--version-script=test.sym 
> -fuse-ld=ld
> llvm-nm -D example.so:
> 
>     0000000000000000 A LIBTEST_1@@LIBTEST_1
>                      w _ITM_deregisterTMCloneTable
>                      w _ITM_registerTMCloneTable
>                      w __cxa_finalize
>                      w __gmon_start__
> 
> LLVM's LLD (i.e. -fuse-ld=lld) does not.
> Many existing packages' symbols files however expect such symbols (e.g. 
> systemd).
> This makes building them cleanly with LLD not possible.
> 
> Rather than considering this a bug in LLD I think it would be more reasonable 
> to
> fix this in dpkg because they're simply noise.

Why? I'm afraid I don't see an underlying rationale for this here. :)

> 1. They are nullpointers and thus don't have any actual underlying 
> implementation.
> 2. If they disappear, the whole section will have been deleted, so certainly 
> other
>    symbols will have also gone missing.

Sometimes you might have empty version nodes.

> I tried reading the binutils code for half an hour to understand where in the 
> code
> and why they're being generated, but had no luck.

Well, from the binutils code, if I'm not reading the location
incorrectly, this really seems to be on purpose, and as such my worry
is that removing these from symbols files could cause ABI issues?

  
<https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/symtab.cc;h=5a21ddc8cc2f560be109f755c3d2bf8a9ef9763c;hb=HEAD#l1618>

And reading something like:

  <http://maskray.me/blog/2020-11-26-all-about-symbol-versioning>

gives the impression this is not implemented in lld, because the
reason for it in binutils is not understood?

Before even considering applying something like this, the above would
need to be clarified with GNU binutils maintainers. And either that
deemed redundant (which I doubt) and to stop emitting them, or for LLD
to start emitting them for compatibility with GNU ld and gold.

Thanks,
Guillem

Reply via email to