[RuntimeDyld] Fix ppc64 stub relocations on little-endian
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 20 Jun 2014 18:17:56 +0000 (18:17 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 20 Jun 2014 18:17:56 +0000 (18:17 +0000)
commite29fc75ea56f08887fb8f05c9b991ff1a0f6c6dc
tree72625522f3d539c496e28d82e7548eb3c89bdc96
parent602941c737718bf875934f5121615eaf2596f196
[RuntimeDyld] Fix ppc64 stub relocations on little-endian

When RuntimeDyldELF creates stub functions, it needs to install
relocations that will resolve to the final address of the target
routine. Since those are 16-bit relocs, they need to be applied to the
least-significant halfword of the instruction.  On big-endian ppc64,
this means that addresses have to be adjusted by 2, which is what the
code currently does.

However, on a little-endian system, the address must *not* be adjusted;
the least-significant halfword is the first one.  This patch updates the
RuntimeDyldELF code to take the target byte order into account.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211384 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp