On Wed, Aug 29, 2018 at 10:31 AM Martin Liška <mli...@suse.cz> wrote:
>
> Hello.
>
> Moving the thread from gcc ML into gcc-patches. That's first implementation
> of shared libgcov library. Currently inclusion of t-libgcov is added only
> to *-linux targets. Is it fine to add to all configurations that already
> include 't-slibgcc t-slibgcc-elf-ver'?
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

I understand this is to make profiling work with multiple DSOs (all
instrumented).
But does this also make the case work when those DSOs are dlopened/dlclosed
multiple times?  I understand that with the shared libgcov implementation this
library must be finalized last?  Wouldn't it be better to have some additional
object that lives in an executable only?  Or do we want profiled DSOs without
profiling the executable using it?  Does that case work with the shared libgcov
(with dlopen/dlclose)?  Does it work when DSO1 is compiled with GCC N
and DSO2 is compiled with GCC N+1 where the libgcov ABI changed?

I think we need a better understanding of the situation before jumping to
the conclusion that a shared libgcov is the solution.  Maybe better isolating
the individual instances is better?

Richard.

> Martin
>
> libgcc/ChangeLog:
>
> 2018-08-28  Martin Liska  <mli...@suse.cz>
>
>         PR gcov-profile/84107
>         * Makefile.in: Build libgcov.so objects separately,
>         add rule for libgcov.map and how the library
>         is linked.
>         * config.host: Add t-libgcov and t-libgcov-elf-ver
>         to *-linux targets.
>         * config/t-libgcov: New file.
>         * config/t-libgcov-elf-ver: New file.
>         * libgcov-driver.c: Declare function if new L_gcov_shared
>         is defined.
>         * libgcov-interface.c: Likewise.
>         * libgcov-merge.c: Likewise.
>         * libgcov-profiler.c: Likewise.
>         * libgcov-std.ver.in: New file.
>         * libgcov.h (__gcov_init): Remove ATTRIBUTE_HIDDEN.
>         (__gcov_exit): Likewise.
>         (__gcov_merge_add): Likewise.
>         (__gcov_merge_time_profile): Likewise.
>         (__gcov_merge_single): Likewise.
>         (__gcov_merge_ior): Likewise.
>         (__gcov_merge_icall_topn): Likewise.
>         (gcov_sort_n_vals): Likewise.
>         (__gcov_fork): Likewise.
>         (__gcov_execl): Likewise.
>         (__gcov_execlp): Likewise.
>         (__gcov_execle): Likewise.
>         (__gcov_execv): Likewise.
>         (__gcov_execvp): Likewise.
>         (__gcov_execve): Likewise.
> ---
>  libgcc/Makefile.in              | 56 ++++++++++++++++++++++++++++++---
>  libgcc/config.host              |  2 +-
>  libgcc/config/t-libgcov         | 46 +++++++++++++++++++++++++++
>  libgcc/config/t-libgcov-elf-ver |  3 ++
>  libgcc/libgcov-driver.c         |  4 +--
>  libgcc/libgcov-interface.c      | 28 ++++++++---------
>  libgcc/libgcov-merge.c          | 14 ++++-----
>  libgcc/libgcov-profiler.c       | 34 ++++++++++----------
>  libgcc/libgcov-std.ver.in       | 53 +++++++++++++++++++++++++++++++
>  libgcc/libgcov.h                | 31 +++++++++---------
>  10 files changed, 209 insertions(+), 62 deletions(-)
>  create mode 100644 libgcc/config/t-libgcov
>  create mode 100644 libgcc/config/t-libgcov-elf-ver
>  create mode 100644 libgcc/libgcov-std.ver.in
>
>

Reply via email to