<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58839>58839</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm-nm incorrectly reports length 0 for buffers defined in wasm32 objs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TerrorJack
</td>
</tr>
</table>
<pre>
Consider this minimal example:
```c
char foo[0x20];
```
If compiled to an ELF object with `cc -c test.c -o test.o` and inspected with `nm -P test.o`, the result will be:
```
foo B 0 20
```
If compiled by clang to a wasm32 object with `clang --target=wasm32-wasi -c test.c -o test.o` and inspected with `llvm-nm -P test.o`, the result will be:
```
foo D 0 0
```
The buffer length is incorrectly reported as `0`. This bug can be reproduced in all recent LLVM major revisions.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytU8GOmzAQ_Rq4jEDGTgIcODSbrtQqlXqIejcwgLcGI9tsNn_fMWy0VVetWqmShWfw-M17M-PatLfqwUxOtWjBD8rBqCY1Sg34IsdZYyQ-ROwUsfv3wLbVbH4zSAudMdH-yF44i_anSBx_Cf35_qcOGjPOSmML3oCc4OP5EUz9hI2Hq_IDBOwGkgY8Op-SZTbL0AHFt6AmN1M0AdzjpxGSr29REX8gKQgW3aIDqtZQ_1bI5pIEOAIDzv6SfH2DRsupX1XAVbpR8Hc61oAk8dL26CNx2sIS2tS_KdT6eUz-k8wTyfyTygth1kvX0UBonHoiQFOhpsZYS6T0jRLOxgZ20gVu4X4KlzA79dJDQz2tA6vZmnZpMMgBSdzoNk4ezudvX2CUT8bSn2flFE1fGmOVHQ55wYo8z-O2Em0pShl75TVWd_HvObg7Q0YzaF9ZO2ixU9OW-K0xLl6srgbvZxdqxB9p9VTepU6pqeSENK9bQtxDJ8lVzi3oyNgXhSjjoap3nciaw04UuCt5lotuV3Zl2wnOaXAFxlrWqF1FLyLifMIrrBBk0-OIVcUZ51nGclZkfJ-n2ElCwgOhFkLuu2jHcJRKp4FHamwf260AVFtHh1o5794OpXOqnxDXdIQvFz8YW13QWmM_y-Z7vGavVvY_AP6yNbA">