[ELF] Do not create interworking thunks for undefined weak references.
authorPeter Smith <peter.smith@linaro.org>
Thu, 3 Nov 2016 11:49:23 +0000 (11:49 +0000)
committerPeter Smith <peter.smith@linaro.org>
Thu, 3 Nov 2016 11:49:23 +0000 (11:49 +0000)
commit2227c7f425129018987e1846ed2360f16eba0729
tree1c87e2e0b3047e0023964d28aaeb1de6fbf5aee8
parentdb68845485d832f44b4a354312ad4645dc545f5c
[ELF] Do not create interworking thunks for undefined weak references.

An undefined weak reference is given an address of 0 this will
incorrectly trigger the creation of a Thumb to ARM interworking Thunk
if there is a Thumb branch instruction to the symbol. This results in
an error as Thunks only make sense to defined or shared symbols.

We prevent this by detecting an undefined symbol and not creating a thunk
for it.

Differential Revision: https://reviews.llvm.org/D26239

llvm-svn: 285896
lld/ELF/Target.cpp
lld/test/ELF/arm-thumb-no-undefined-thunk.s [new file with mode: 0644]