https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123480

Icenowy Zheng <uwu at icenowy dot me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #19 from Icenowy Zheng <uwu at icenowy dot me> ---
Well I am not sure whether this is a libstdc++-specific problem:

```
(ssh)root@musebook [ ~ ] # gcc test.c -Wl,-Bstatic -lz -Wl,-Bdynamic
(ssh)root@musebook [ ~ ] # nm -D a.out 
                 U aligned_alloc@GLIBC_2.27
                 w __cxa_finalize@GLIBC_2.27
                 U free@GLIBC_2.27
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 U __libc_start_main@GLIBC_2.34
0000000000000842 T main
                 U puts@GLIBC_2.27
(ssh)root@musebook [ ~ ] # ldd a.out 
        linux-vdso.so.1 (0x0000003f9854a000)
        libc.so.6 => /usr/lib/libc.so.6 (0x0000003f9838a000)
        /lib/ld-linux-riscv64-lp64d.so.1 =>
/usr/lib/ld-linux-riscv64-lp64d.so.1 (0x0000003f9854c000)
(ssh)root@musebook [ ~ ] # ./a.out 
1.3.1.zlib-ng
(ssh)root@musebook [ ~ ] # nm -D /usr/bin/gcc | grep cxx | wc -l
226
(ssh)root@musebook [ ~ ] # cat test.c
#include <zlib.h>
#include <stdio.h>

int main()
{
        printf("%s\n", zlibVersion());
}
```

Statically linking a zlib-ng here does not pollute the dynamic symbol list of
my executable.

Reply via email to