[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)
commit32626014a62e8e7015d48d840122dd148e1ed609
tree317f48cbe18b177b01535043d0643216625f223a
parent4eff6cdd2e25a0eab795ca74a4db896f225fa7f5
[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.

llvm-svn: 211384
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp