[llvm] [MC][AsmParser]: Cache files loaded by .incbin across repeated directives (PR #194254)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 27 06:33:14 PDT 2026
SergeantCooper wrote:
@aengelke I haven't tested this with wine but have tested with a minimal producer which I believe replicates the erroneous behavior related to wine's source code
The bibisected [commit](https://gitlab.winehq.org/wine/wine/-/commit/0b3f90ab1485d5bd32bd72d41c7fd8213b3b95b9) has this change
```
for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++)
{
output( "\n\t.align %d\n", get_alignment(4) );
output( ".L__wine_spec_res_%d:\n", i );
output( "\t.incbin \"%s\",%d,%d\n", res->input_name, res->input_offset, res->data_size );
}
```
I used the following assembly file for testing
```
.data
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
.incbin "blob.bin", 0, 16
... till 1000 reps
```
The blob size was 1M and generated an output file with both system and local build llvm-mc for which the memory details are mentioned in the description.
https://github.com/llvm/llvm-project/pull/194254
More information about the llvm-commits
mailing list