<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62728>62728</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lld --oformat=binary not working with link script AT section attributes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
xiaoxiangmoe
</td>
</tr>
</table>
<pre>
reproduction https://github.com/xiaoxiangmoe/issue-llvm-lld-oformat-binary-compability
linker.ld
```ld
ENTRY(main);
SECTIONS
{
. = 0x7C00;
.text : AT(0x7C00)
{
*(__start);
_text = .;
*(.text);
_text_end = .;
}
.sig : AT(0x7DFE)
{
SHORT(0xaa55);
}
}
```
---
When using lld without `--oformat=binary`
The result is
```
hexdump -C dist-lld-elf/boot.bin
00000000 eb fe cc cc 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200
```
it works well
---
When using lld with `--oformat=binary`
The result is
```
hexdump -C dist-lld-binary/boot.bin
00000000 eb fe cc cc 55 aa |....U.|
00000006
```
The AT section attribute is not working at all.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vctu2zAQ_BrqspBAUU8fdHCsGO0lARIXRU8GJa0tNpRokFTt_H2hh-NHDBct0AVhQ9TuzHKGWHFjxLZFzEj0QKLc4Z2tlc4OgquD4O22UegUqnrPCM0JnWvcaVV1pRWqhdranSHBnLAlYcutsHVXeKVqCFue1xO2FMZ06Er5q3GlrFy1Ubrh1i1Ey_W7W6pmxwshhX0fWcZfKdo31J6szjdJTMd13H58Wr38ICxtuGgJm5HgYdx_fVysvj4_vU5lybQNHpAgB3pIFpR-JAMAeBYPFkgwh_mKsHTKYLNTxglkCsLmhKXrtbFc23NyWE9gOXgXJKeqge6iZoqhdI1tdaOcJPnxGEZsL5rNl4_3m3398vwy5nIeRdfMH8gkyeFK6nP9Xdc9f_xeYwudEe0WpKxgL2ytOgskpu7RZRLko89XSKsaQaPppAVhbjLWeKi6ZgfuAiph7HB1UG4IWxZKWa8Qbd_4kEqnAMACNghl2S9KT-vi4eIFSRbeVZBkcY7r3yv_J9z-DpwI_M0dnM8rioDzG_jfrvpmlN5xUljYK_1mYI9S_p3F_9HfCerC4j_HvUswqjWJdS0RpfEdifojzFdgcJx33Fotis4iCAOtGvXrdeEWuJTe1IZTZUE1C2bcwcyP05BRn6Yzp86KTVjFSDHwk9SPNwXjPsUIyzQsqlmI3BEZoyygkR9TP0jpzPMTHnI_8tMgKEs_CklIseFCev0o9ZTeOsNkzWKWsNSRvEBphknOWIt7GF4SxvrBrrNh_Bbd1pCQSmGsOaFYYSVmvb2fbb046eB-P5jBlFrs7E15jNNpmd35OvS805-70-onlvb4kTCELYfT_A4AAP__Qlu-qA">