Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Fix the PPC assembler
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoechtrager committed Oct 17, 2015
1 parent 04115db commit 19f2dea
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cctools/as/m88k.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,10 @@ char *op)

/* if this instruction requires labels mark it for later */
switch (insn.reloc) {

case NO_RELOC:
break;

case M88K_RELOC_LO16:
case M88K_RELOC_HI16:
fix_new(
Expand Down
3 changes: 3 additions & 0 deletions cctools/as/ppc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,8 @@ char *op)

/* if this instruction requires labels mark it for later */
switch(insn.reloc){
case NO_RELOC:
break;
case PPC_RELOC_HI16:
case PPC_RELOC_LO16:
case PPC_RELOC_HA16:
Expand All @@ -1033,6 +1035,7 @@ char *op)
insn.reloc);
break;
case PPC_RELOC_BR14:
case PPC_RELOC_BR14_predicted:
fix_new(frag_now,
thisfrag - frag_now->fr_literal,
4,
Expand Down
14 changes: 14 additions & 0 deletions cctools/as/sparc.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,20 @@ sparc_ip (str)
/* plug absolutes directly into opcode */

switch(the_insn.reloc) {
case SPARC_RELOC_13:
if (the_insn.exp.X_seg == SEG_BIG)
opcode |= (*(int *) generic_bignum) & 0x1fff;
else
opcode |= the_insn.exp.X_add_number & 0x1fff;
the_insn.reloc = SPARC_RELOC_NONE;
break;
case SPARC_RELOC_22:
if (the_insn.exp.X_seg == SEG_BIG)
opcode |= (*(int *) generic_bignum) & 0x3fffff;
else
opcode |= the_insn.exp.X_add_number & 0x3fffff;
the_insn.reloc = SPARC_RELOC_NONE;
break;
case SPARC_RELOC_HI22:
/* extract upper 22 bits from constant */
opcode |= (the_insn.exp.X_add_number >> 10) & 0x3fffff;
Expand Down

0 comments on commit 19f2dea

Please sign in to comment.