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

    <tr>
        <th>Summary</th>
        <td>
            lld/mach-o with -exported_symbol emits "cannot export hidden symbol __llvm_profile_raw_version" after D135340
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld:MachO
      </td>
    </tr>

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

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

<pre>
    In https://reviews.llvm.org/D135340 the `__llvm_profile_raw_version` and `__llvm_profile_filename` symbols which clang emits with `-fprofile-generate` were made hidden.

This caused lld/mach-o to start warning when building dylibs with `-exported_symbols_list` (or just `-exported_symbol`).

Here is a reproducer at 4ea1a647ff0973c683dd71fec77e6fe7f6dfd2ca:

```
$ cat /tmp/a.cc
extern "C" int foo() { return 42; }

$ build/bin/clang -shared -fuse-ld=lld --target=x86_64-apple-macos -fprofile-generate -mmacos-version-min=10.13 -Wl,-exported_symbol,_foo -o /tmp/a.dylib /tmp/a.cc
ld64.lld: warning: cannot export hidden symbol __llvm_profile_raw_version
>>> defined in /tmp/a-edce60.o

ld64.lld: warning: cannot export hidden symbol __llvm_profile_filename
>>> defined in /tmp/a-edce60.o
```

Summoning some lld/mach-o folks: @speednoisemovement @gkmhub @int3 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVE2P4zYM_TX2hbBhS44dH3yYmXTRHooeWqBHQ7boWLv6CCR5MtNfX9pOt8nuoIdtoiiiKJFP5CMHJ9-7XyzMMV5Cwp8S9omGx1eF15Br_Wpy58-0dSr5gVcFxBkhqYu-X3X9xbtJaey9uPav6INylpQgrPzg0DpZYXA9Ed7N4HSA66zGGUYt7BnQqEg7Ks7r5Wy63cvOaNGLuN27okcwQiLMSkq0eVKckuJpn_-YVYBRLAElaC0JtRHjnDmIDkIUPsJVeKvI1XVGC8OitFwl-a7VcOcZ3y7OR5T9DWWvVYir94QdnYfPS4gfnaOthLUPiH5e4RIoAR7pOXIZ0YOIUKEoRV0101S0DR_rI5eyKSccmwbrCZuplpNko1gzcmdu9bCPXWQVPZewsE_RXGgW-TjuKnyL6C1p2Av9QNkIk3OEnxBC0jwTnrjQgYol_Jk2Tg9uyO4WHDI5KEvznqAszMJTbLOJQpyRmp8ozJBlFNszRhLfjnVfV5m4XChvFHwX4Ps8QmY2VXZjTGbIBz-VRV5yyP7UCXv5LrTspSf8QLm8e-yWt49er2Vd5SsD-NM_KV-Xo7DWRdht3wh0YyL8B6H3mPCf9gESJ2UpCsreuc5QjlgXubuP4_-H8bVkfgTDN2TZ5t8XY9xWAsEZfKySyekvaw-ApCrCBVFapwIa94oGiT-0e_5i5mVYV0QoDil2ZV0fqrJoqzaVHZctb0UaVdTYPZjeSuvbpN4Knvj5g4khYouJeA635pQuXnePnexMjpchH50hYTV0-8vI3mccI4kqhAUDLQ5HVh_SuWsm5MNQsaY-FA3VaDUVI32O9fFIpcrbVIsBdeiSwzNB2PP7K73zN5KSwylVHSsYKwv6VkVbtLng5QHZyIqmrpCzluKHRij9tb-mvttADcs5kHJtN_8231SEoM4WcXNI9sUSZ-e7v4yTaNINfrdh_xslStwJ">