In PowerPC as, allow a lonely lo16 without hi16 or ha16.
authorGeorge Koehler <xkernigh@netscape.net>
Thu, 2 Feb 2017 15:35:34 +0000 (10:35 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Thu, 2 Feb 2017 15:35:34 +0000 (10:35 -0500)
The intent is to assemble code like

    lis r3, ha16[_sym]
    lwz r4, lo16[_sym](r3)
    addi r4, r4, 1
    stw r4, lo16[_sym](r3)

mach/powerpc/as/mach5.c

index 3029b7d..355376f 100644 (file)
@@ -169,7 +169,10 @@ void emit_hl(word_t in)
                  */
                 relonami = 0;
             } else {
-                serror("lo16 without hi16 or ha16");
+                /* This is a lonely lo16 without hi16 or ha16. */
+                DOTVAL += 2;
+                newrelo(hl_expr.typ, RELO2 | FIXUPFLAGS);
+                DOTVAL -= 2;
             }
         }
         break;