[ELF] ARM and AArch64 undefined weak reference values
authorPeter Smith <peter.smith@linaro.org>
Wed, 9 Nov 2016 10:22:29 +0000 (10:22 +0000)
committerPeter Smith <peter.smith@linaro.org>
Wed, 9 Nov 2016 10:22:29 +0000 (10:22 +0000)
commit8339bbd75929ad2d28b4a5a8777bf34f783cc131
tree8d6aeacaf6e65912177e82afd72150ece3c0c57c
parent222fd13e3f53881026111935f655f806a79153c7
[ELF] ARM and AArch64 undefined weak reference values

The ARM 32 and 64-bit ABI does not use 0 for undefined weak references
that are used in PC relative relocations. In particular:
- A branch relocation to an undefined weak resolves to the next
  instruction. Effectively making the branch a no-op
- In all other cases the symbol resolves to the place so that S + A - P
  resolves to A.

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

llvm-svn: 286353
lld/ELF/InputSection.cpp
lld/test/ELF/aarch64-undefined-weak.s [new file with mode: 0644]
lld/test/ELF/arm-thumb-no-undefined-thunk.s
lld/test/ELF/arm-thumb-undefined-weak.s [new file with mode: 0644]
lld/test/ELF/arm-undefined-weak.s [new file with mode: 0644]