On Thu, Sep 17, 2020 at 12:56:59PM +0200, Florian Weimer via Gcc wrote: > * Bin Cheng via Gcc: > > > Last question is why do we have __aarch64_have_lse_atomics(and some > > other symbols) in both libgcc and glibc? > > > > #objdump -t /usr/lib64/libc.so.6 | grep "__aarch64_ldadd" > > > > 0000000000111460 l F .text 0000000000000030 > > __aarch64_ldadd8_acq > > > > 0000000000111370 l F .text 0000000000000030 > > __aarch64_ldadd8_relax > > > > 00000000001114c0 l F .text 0000000000000030 > > __aarch64_ldadd8_rel > > > > 00000000001113d0 l F .text 0000000000000030 > > __aarch64_ldadd4_acq > > I'm pretty sure those symbols are unexpected symbols in .symtab, i.e., > your libc.so.6 is not stripped (which helps debuggers and valgrind).
The symbols should be STV_HIDDEN, yes, they should show up in .symtab if not stripped, but not in .dynsym. The point of -moutline-atomics is that the symbols appear in every shared library and every binary that uses them to avoid the PLT costs (at the cost of having to initialize the var in every library/binary separately). Jakub