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

    <tr>
        <th>Summary</th>
        <td>
            hwasan: globals which have been assigned a section cannot be instrumented
        </td>
    </tr>

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

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

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

<pre>
    https://github.com/llvm/llvm-project/blob/0a68a9d6c5f37f63a821948a43315ba4dcd69acc/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp#L1782

```
// Globals with custom sections may be used in __start_/__stop_ enumeration,
// which would be broken both by adding tags and potentially by the extra
// padding/alignment that we insert.
```

I'm not really sure what possible scenario this could be relating to, however there should be a way to bypass this check and allow all globals to be instrumented.

I'm using llvm's hwasan instrumentation with a custom runtime for embedded (baremetal) environment, where assigning sections of code/data symbols is heavily used. It is desirable to instrument all globals and work around any issues which arise from that.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE2v6yYT_jVkM3ojGztxsvAi763cHqm7VuryaIBxoAdDxOC46a-vcJx7Tu-uEkose-bh-RhAZncNRL04_F8cftrhnG1MPdt5HD3JnYrm0ducbyyai5CDkMPVZTurvY6TkIP399ff_24p_kk6CzkoH5WQQ4XHE57NUR_GphuPDZ5kfW5P2DZNfVDYGm2OZ9T6C44rfb8nDDzGNLGQw1vgnOaJQsbsYhBy-OWPizGJmH_D4LL7m9Je325CNr_W3UmK6lLWsdpWtdGGn31U6BkWly3omXOcgEkXUIYJH6AIZiYDLsD7O2dM-V3IoTzG2ztQmCdKG4dvn7CLddrCEmdvCoJK8YMCqJgtqAegMS5cIeOVAYOBW8wUskPvH-VztgT0V074iXd7tgg5oHfXUIRDtphhIXCBKeX9j_qqy5uQ3QQhZki0YvOcCJbSdovMTnkC1hQwuQjZOgb9IpzIY145RiG_gY0L3SkVZomA7asMYcEH5AjqcUPmDcSS_lh1ofdxKb9w3WwupSvjLT0y-69cZy57PmPvGOyCjOFL-Wr0Myt8pZXmkN1EMMYENCkyhgwIeVKYaKKMXsgzULi7FFffip5l1fEc87Lj98TjCDoaEnIwmBH4ManoGRyDJbw7_1iHYQ9vubwzxC5hsTHHLyz_pbj4sMT0AZjiXDwJD3DMM_E2JJgcE4wpTmui-53pG3Nuzrijvu7a0-l06KpmZ_u2wq5qjWqORiqpG6zb7lCPh840DXUntXO9rOShOlay7ppD1ezrUTdaH0lS19V4HEVb0YTO74vD-5iuu5VJX7eybeXOoyLP66GXMtDy5CmkLHdA6tfjrOYri7byjjN_wmSXPfXPuERz-S7-qdDinUARhc1xMoAvy0FjKBP6w1Ts5uT_-w3z9FXIYRN07-U_AQAA__-9z5_8">