Add RELOLIS for PowerPC lis with ha16 or hi16.
authorGeorge Koehler <xkernigh@netscape.net>
Wed, 8 Feb 2017 16:46:31 +0000 (11:46 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Wed, 8 Feb 2017 16:46:31 +0000 (11:46 -0500)
commit1bf58cf51c9bff076485e249ef5b708483055b4a
tree5b5ae26de76a93dd8eca65f748229625fd4b93dc
parentf4cfbedd5c74e82494770afd62f9fe22e1cba8c7
Add RELOLIS for PowerPC lis with ha16 or hi16.

The new relocation type RELOLIS handles these instructions:

    lis RT, ha16[expr] == addis RT, r0, ha16[expr]
    lis RT, hi16[expr] == addis RT, r0, hi16[expr]

RELOLIS stores a 32-bit value in the program text.  In this value, the
high bit is a ha16 flag, the next 5 bits are the target register RT,
and the low bits are a signed 26-bit offset.  The linker replaces this
value with the lis instruction.

The old RELOPPC relocated a ha16/lo16 or hi16/lo16 pair.  The new
RELOLIS relocates only a ha16 or hi16, so it is no longer necessary to
have a matching lo16 in the next instruction.  The disadvantage is
that RELOLIS has only a signed 26-bit offset, not a 32-bit offset.

Switch the assembler to use RELOLIS for ha16 or hi16 and RELO2 for
lo16.  The li32 instruction still uses the old RELOPPC relocation.

This is not the same as my RELOPPC change from my recent mail to
tack-devel (https://sourceforge.net/p/tack/mailman/message/35651528/).
This commit is on a different branch.  Here I am throwing away my
RELOPPC change and instead trying RELOLIS.
h/out.h
mach/powerpc/as/mach1.c
mach/powerpc/as/mach4.c
mach/powerpc/as/mach5.c
util/amisc/ashow.c
util/led/relocate.c