<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56422>56422</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Coverage reports wrong accesses with (lotsa) shared libraries
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nolange
      </td>
    </tr>
</table>

<pre>
    I am trying to test a significant number of plugins - shared libraries that are loaded with `dlopen` and `dlsym`.
So for a couple of them have a testsuite, and I went ahead and produced one executable that will dynamically load a plugin, run the tests and then unload the plugin.

Some odd stuff already seems to be happening with the statically linked profiling runtime, see #55682, preventing the runtime to be linked with exporting `__llvm_profile_runtime` just doesn't work for me.

The result is that the coverage seems fine for the plugins having a testsuite (comparing it to a stand-alonge test binary only for that plugin), but a whole bunch of plugins **that aren't even loaded into the process** have hits displayed (i automatically add all plugins to llvm-cov` as `-object`).

I am unsure why this happens, but it seems the "signature" is only compromised of some counts of added instrumentation, not something less likely to cause conflicts like a hash of the binary (build-id).

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxlVMtu2zAQ_Br5QthQ5dixDzq0DQLk3N4DilxZTChS4COu_r6zlNS0KCzApEjOzs4M1Xk9ty9CjiKF2bibSF4kiklIEc3Nmd4o6ZJweewoCN-LyeabcVHsRRxkIC2s6YIMhqJIg8S5QMJ6qbFyN2kQ1bnW1k_kMBDS6eVFnEf8H6r6qaq__vCi9wEVlc-TJa6SBhrFID8Ib5lOzCZR1XwvCC_iTuAkB5K6vJiC11mhonck6BepnGQHoELobqwVenZyRCvWzoUdYJdGGDNkxwWXQgUQMyeyKzt5Zdm70t1Ij2CqtYgp972QNoDNLCLRGFnEjsB_Qt8salGCgWKSaaNh3DsV7r2xvAk0khlLl0ARVXM8nc6XhudToA-0XPwByrpzLbMClRr0a_Kh7IO8r6_Wfo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