[llvm-bugs] [Bug 40250] New: AArch64 ifunc broken: can't create dynamic relocation R_AARCH64_ADR_GOT_PAGE
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Jan 7 16:37:42 PST 2019
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: unassignedbugs at nondot.org
Reporter: eugeni.stepanov at gmail.com
CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org
# 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190108/ca0ae118/attachment-0001.html>
More information about the llvm-bugs
mailing list