ld: map file entries of symbols in static libraries built with LTO

Nick Clifton nickc@redhat.com
Tue Apr 6 14:32:24 GMT 2021


Hi Christian,

   [Sorry for the long delay in replying - I am way behind on my emails...]

> When I compile and link an executable against a static library (both with LTO) the map file of the resulting executable is missing the addresses of the symbols in the static library. The only reference I get is a line like this one:
> 
>     libmylib.a(myfunc.c.o)        CMakeFiles/app.dir/main.c.o (symbol from plugin) (myfunc)
> 
> The function in question (myfunc in this case) has not been inlined (according to objdump -S).
> 
> Why is this happening and what can I do about it?

Presumably it is because of the LTO compilation, although it is hard to be sure.
If this is still a problem for you, please could you file a bug report here:

   https://sourceware.org/bugzilla/enter_bug.cgi?product=binutils

if you can include a small test case to reproduce the problem that would really help.

Cheers
   Nick



More information about the Binutils mailing list