[llvm] [BOLT] Check if symbol is in data area of function (PR #160143)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 10:35:55 PDT 2025


maksfb wrote:

> .text
> .global foo
> foo:
>         adrp    x0, .Lp
>         add     x0, x0, :lo12:.Lp
>         ldr     w0, [x0]
>         bl L2
>         ret
> $d.L1:
> .Lp:
>         .word   0x123FFF
> $x.L2:
> L2:
>         ret

I tried this example with the patch, and I'm getting:
```
BOLT-WARNING: symbol L2/1 is in data region of function foo(0x10284).
```
which is incorrect since L2 is not in the data area. Without looking further into it, I suspect it's the consequence of using `Symbol->getOffset()` to establish constant island an symbol association.

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


More information about the llvm-commits mailing list