The function pointer in get may get overridden by the foo from an other TU.
So the compiler needs to generate a relocation. but in this case it doesn't.
Maybe the problem is simply that foo is emitted with dso_local.
Note that other backends(X86, aarch64) still generate relocations even with the dso_local.
Make file with the following named tmp.ll
```llvm
define weak dso_local arm_aapcscc i32 @foo() {
ret i32 9
}
define dso_local arm_aapcscc ptr @get() {
ret ptr @foo
}
```
run:
```bash
clang++ -target arm-none-linux-android tmp.ll -c -o out.o
llvm-objdump -r out.o
```
the function pointer in `get` may get overridden by the `foo` from an other TU. so the compiler needs to generate a relocation. but in this case it doesn't.
Make file with the following named tmp.ll
```llvm
define weak dso_local arm_aapcscc i32 @foo() {
ret i32 9
}
define dso_local arm_aapcscc ptr @get() {
ret ptr @foo
}
```
run:
```bash
clang++ -target arm-none-linux-android tmp.ll -c -o out.o
llvm-objdump -r out.o
```
the function pointer in `get` may get overridden by the `foo` from an other TU. so the compiler needs to generate a relocation. but in this case it doesn't.
Make file with the following named tmp.c
run:
The function pointer in
get
may get overridden by thefoo
from an other TU. So the compiler needs to generate a relocation. but in this case it doesn't.Maybe the problem is simply that
foo
is emitted withdso_local
. Note that other backends(X86, aarch64) still generate relocations even with thedso_local
.