Change RELOPPC to allow gap between ha16 and lo16.
authorGeorge Koehler <xkernigh@netscape.net>
Mon, 6 Feb 2017 19:17:28 +0000 (14:17 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Mon, 6 Feb 2017 19:17:28 +0000 (14:17 -0500)
commit530860d7bb088cc51e8f0bcdc913af5190532fae
treed5139bdfef00b4ebeb3f0bd6731d15c1daa0e967
parente947ce7a7fbdf554ebcde07649dadbcbdcd50690
Change RELOPPC to allow gap between ha16 and lo16.

This change breaks old .o files.  The linker will probably (but
perhaps not always) say, "Don't know how to read from PowerPC fixup",
when it encounters a RELOPPC in the old format.

The new format divides the 32-bit value into two parts.  The lower 26
bits encode a signed 26-bit offset from the symbol.  The higher 6 bits
encode the distance (in 1 to 63 instructions) from the hi16 or ha16 to
the lo16.  The old format had a 32-bit offset, but the lo16 needed to
be in the next instruction after the hi16 or ha16.

The assembler fails if an offset is too big for signed 26-bit.  Before
this change, we restricted branch instructions to a signed 26-bit
offset, but now I also restrict hi16 and ha16 instructions.
mach/powerpc/as/mach5.c
util/led/relocate.c