aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-01-19 21:23:57 -0800
committerFangrui Song <i@maskray.me>2021-01-19 21:23:57 -0800
commitf96ff3c0f8ebd941b3f6b345164c3d858b781484 (patch)
tree53b33ac484dcb4bea50a1cdf7d6448acb600ac7e /clang/lib/Frontend/CompilerInvocation.cpp
parent8031785f4a7ebd027edb34c91cbcf48db53ef444 (diff)
downloadllvm-f96ff3c0f8ebd941b3f6b345164c3d858b781484.zip
llvm-f96ff3c0f8ebd941b3f6b345164c3d858b781484.tar.gz
llvm-f96ff3c0f8ebd941b3f6b345164c3d858b781484.tar.bz2
[ELF] --wrap: Produce a dynamic symbol for undefined __wrap_
``` // a.s jmp fcntl // b.s .globl fcntl fcntl: ret ``` `ld.lld -shared --wrap=fcntl a.o b.o` has an `R_X86_64_JUMP_SLOT` referencing the index 0 undefined symbol, which will cause a glibc `symbol lookup error` at runtime. This is because `__wrap_fcntl` is not in .dynsym We use an approximation `!wrap->isUndefined()`, which doesn't set `isUsedInRegularObj` of `__wrap_fcntl` when `fcntl` is referenced and `__wrap_fcntl` is undefined. Fix this by using `sym->referenced`.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions