[mach-o] Implement interworking between thumb and arm code
authorNick Kledzik <kledzik@apple.com>
Mon, 28 Jul 2014 23:06:09 +0000 (23:06 +0000)
committerNick Kledzik <kledzik@apple.com>
Mon, 28 Jul 2014 23:06:09 +0000 (23:06 +0000)
commit54fd4e5fcb5adad4fcb313ee94b4f2c9e4c1e69f
tree798e8f6387a35c744c2ba0d28923477868f8b0d7
parentbd1628a595b27f05c130c0b5127eee32abdf0e38
[mach-o] Implement interworking between thumb and arm code

All iOS arm processor support switching between arm and thumb mode at call sites
by using the BLX instruction (instead of BL).  But the compiler does not know
the implementation mode for extern functions, so the linker must update BL/BLX
instructions to match what is linked is actually linked together.  In addition,
pointers to functions (such as vtables) must have the low bit set if the target
of the pointer is a thumb mode function.

llvm-svn: 214140
lld/lib/ReaderWriter/MachO/ArchHandler_arm.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
lld/test/mach-o/arm-interworking.yaml [new file with mode: 0644]
lld/test/mach-o/hello-world-armv7.yaml [new file with mode: 0644]