<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/114141>114141</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Bad linker (lld) code den when using linker script AT command with --oformat binary.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
lld
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
LinkerScript1
</td>
</tr>
</table>
<pre>
Using AT with --oformat binary results in the linker printing errors the size of the` .data` section exceeding the size of flash.
It seems that the linker is swapping the load address with the ram address, since replacing `> ram AT > flash` with` > flash AT > ram`in the ` .data` section of a minimal linker script eliminates the issue (and results in a binary that runs normally). Keeping `> ram AT > flash` in the script and reducing address of the `ram` memory region results in the error about the size being exceeded (flash address is 0) disappearing and a binary with a size slightly larger than the `ram` address being generated (which is exactly what would be expected if ram were being treated as the load address).
Someone mentioned this problem before (but with the other AT syntax and without the work around) here: [](https://github.com/llvm/llvm-project/issues/62728).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVM2uozYUfhqzOboIDMmEBYtMp5Gqdje3D3CwT8Ad_yDbDEmfvrIJTTq3UqVuwLKPv_P92MYQ1GiJenb4zA5fClzi5Hz_m7LfyH8VXs2xLgYn7_3vQdkRzu-wqjjB25u7Om8wwqAs-jt4CouOAZSFOBHoDACzVzamfeS98yEvBfUngbumMTtWUEqMmAaBRFTOAt0EkUybXquvGsNUsuoLq87b95cIgcgkUIyvTVWAsOI87xDaoQSU0lMIG_s069Hsk4z_BEFZQeBp1ijSRnasWPNzrjq_QxpmBologkj_vyf3Co-GHauHA_-qzV0BwSirDOqdbsguA2lllMVIm0sqhIWA8RNa-Wou7oZn1X6xAWwKQus7410JvxLN_8H_QfDRd8OXS1a9u7TFk0A2TWDIuJzymGT8EHYOF3BwS3xmNlDOPYdJMinZvNpbqAAV4x1IFXCeCX3ub-VTYY4KN7Sg1ThFfQeNfiSf1NsfKO7AW-ORLHmMW-d1UmJKHemGIqGsybzVLVrCQEC3mUQqVdds2Ep-5x89ZRAMH45Ssvv1PH51hpwlMGRT1iQhTirA7N2gycBAV-dzosMSn8fQxYl8iijcbcRbdiAt7l6uzn8D9G6xMrk1kSfWnGG7royfphjnwJoz4xfGL6OK0zKUwhnGL1p_339vs3d_kIiMX_LBCoxfjvwTPyURhewb2TUdFtTXn5qKt_WxaYupF0LSdUDeHQjxQKJpxKEVXBCXQ1V3XaF6nqor3nHeVk1biurEDw2d2qbi1RFPrK3IoNJlIlE6Pxa5fV_Xbd3WhcaBdMhvD-daS8Z5eoR8nzkPyxhYW2kVYngCRBU19Z9R7veH8VPe2oFwkkCShXUiC0t-sP55yc7vIJwxu8kfnrGyWLzu_7-nD13fe_5XAAAA___9dcyy">