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

    <tr>
        <th>Summary</th>
        <td>
            [LLD][CRASH]Cannot allocate memory
        </td>
    </tr>

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

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

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

<pre>
    Using lld with common-page-size=2097152,when I run it, it came to a crash.
```
error while loading shared libraries: cannot apply additional memory protection after relocation: Cannot allocate memory
```

The execution script `try.sh` is as follows:
```sh
#!/bin/bash

# set -e

export PATH=/home/xxx/works/llvm_org_test/clang+llvm-17.0.5-aarch64-linux-gnu/bin:$PATH
export LD_LIBRARY_PATH=/home/xxx/llvm_org_test/clang+llvm-17.0.5-aarch64-linux-gnu/lib:$LD_LIBRARY_PATH


# clang --version
# which clang
echo "llvm test:"
clang test.c -o test -Wl,-zcommon-page-size=2097152 -no-pie -fuse-ld=lld
./test

echo -e "\n\ngcc test:"
gcc test.c -o test -Wl,-zcommon-page-size=2097152 -no-pie 
./test
```

The `test.c` is as follows:
```c
int main(){}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVMFupDgQ_ZriUjICG0L3gUN3sygj5bDKzmq1e4mMMdizBrdsM92Zr1-ZZrJRJrlEAoNfUfWeqh7m3utxlrKG8ghlk_AlKOvqf75dDuH-knS2f67_9Hoe0ZgeLzooFHaa7EzOfJTE6x8SWEOzfZWXFH5r4XiC3emi5Ixf0C0z6gD0hDqg4JPEYJGjcNyrFLIGsgPcZdu1bqVz1uFFaSPRWN5HYq-4kz0a3TnutPTADij4PNuA_Hw2z8j7XgdtZ25wkpN1z3h2NkgRMeRDkA6dNFbwCMTs05ZtVlBuWe8Kuq1flUR5lWJZS3rh9Dkg3GXBPadewV2G2iP3OFhj7MVvfdgf3pT0agMoA5oDbTs9x5W_BH6G0cuARL5G5fVsXcDfD1_vgTVAW2UnCbS9Xq9A24t1_3qgrTHfpyfrxqcgfQDaCsPnEegx4iSv0iwtCedOqLuCGD0vVzLOy6aEHYAWa_3XhA_N08OX4-Ph8e-nD7g_y2l0d-N8S_G6Fy8dWasiId-l83GOL4GL0kLdwptwoSwCpZEfV02Rhd6CtzIRTQUSu74h-csAPZEfH1sbyWzJWUskw-IlMT2wxpj-VjMF2q48r8cVRRAZdUB5muM9CvGLnJ_Y58S8S_-RgaNfV6Zf_creOlXc9noOOPFo0h3QPVRHqJo3XyZ9zfo92_NE1nmVZVWelcUuUXU2FFWX76quGrjI9wMfclrk3TCIPi_7oUh0TTPK8pyyjLGy2KWUl2JXVTTjXDJW7KDI5MS1SeMgU-vGRHu_yLpiNGOJ4Z00fj234qj7tdFN4urVdt0yeigyo33w_-cHHcx61D08NFA2UB5Pj4c_7qFs3j8SksWZWoVwXltEW6DtqINaulTYaXP-9iBnZ79JEf2_qow_4yr0vwAAAP__mf6ebg">