https://bugs.llvm.org/show_bug.cgi?id=40250
Bug ID: 40250
Summary: AArch64 ifunc broken: can't create dynamic relocation
R_AARCH64_ADR_GOT_PAGE
Product: lld
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: ELF
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
# cat 1.cc
static void fff_impl() {}
extern "C"
void *fff_resolver() {
return (void *)&fff_impl;
}
__attribute__((ifunc("fff_resolver")))
void fff();
int use() {
long z = reinterpret_cast<long>(&fff);
if (z & 0xa)
return true;
else
return false;
}
# bin/clang++ ../llvm-project/1.cc -target aarch64-linux-android -fPIC
-shared -fuse-ld=lld -B ~/build/android-ndk-r18b/standalone-arm64-api24/
--sysroot ~/build/android-ndk-r18b/standalone-arm64-api24/sysroot/
-stdlib=libstdc++
ld.lld: error: can't create dynamic relocation R_AARCH64_ADR_GOT_PAGE against
symbol: fff() in readonly segment; recompile object files with -fPIC or pass
'-Wl,-z,notext' to allow text relocations in the output
>>> defined in /tmp/1-c41c9b.o
>>> referenced by 1.cc
>>> /tmp/1-c41c9b.o:(use())
ld.lld: error: can't create dynamic relocation R_AARCH64_LD64_GOT_LO12_NC
against symbol: fff() in readonly segment; recompile object files with -fPIC or
pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in /tmp/1-c41c9b.o
>>> referenced by 1.cc
>>> /tmp/1-c41c9b.o:(use())
clang-8: error: linker command failed with exit code 1 (use -v to see
invocation)
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs