[clang] [llvm] [llvm] Avoid resolving `.incbin` during symbol collection (PR #172920)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 12 13:21:40 PST 2026


jansvoboda11 wrote:

> Unfortunately, .incbin can actually affect the set of defined symbols. A .if directive can check the number of bytes included by a .incbin directive, so it's possible to write an assembly file where the set of defined symbols depends on the size of the included file.

That didn't occur to me, thanks for pointing it out. Do you have something like this in mind?

```asm
data_start:
    .incbin "myfile.bin"
data_end:

.if (data_end - data_start) != 0
    conditional_symbol = 1
.endif
```


https://github.com/llvm/llvm-project/pull/172920


More information about the cfe-commits mailing list