Open
Description
Make file with the following named tmp.c
int __attribute__((weak)) foo() { return 9; }
typedef int (*func_ptr)();
func_ptr get() { return &foo; }
run:
clang -target arm-none-linux-android tmp.c -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.
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
.