diff options
author | Jeff Law <law@redhat.com> | 1996-08-31 05:52:38 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1996-08-31 05:52:38 +0000 |
commit | 74dd0c0786adef6d761ec73b08102338070abc78 (patch) | |
tree | dc87ef1943b2073f0fd12af3a07ef00cef61419e /gas | |
parent | 7ab4a84a3a66d2f3b3fb929177820516a2a47e02 (diff) | |
download | gdb-74dd0c0786adef6d761ec73b08102338070abc78.zip gdb-74dd0c0786adef6d761ec73b08102338070abc78.tar.gz gdb-74dd0c0786adef6d761ec73b08102338070abc78.tar.bz2 |
* config/tc-v850.c (md_apply_fix3): Use little endian get/put
routines to fetch/store the updated instruction from/to memory.
(v850_insert_operand): If the operand has a specialized insert
routine, call it.
Getting fixups closer. At least br <target> works now.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-v850.c | 25 |
2 files changed, 28 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index c480f7a..0ba20b8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,4 +1,11 @@ start-sanitize-v850 +Fri Aug 30 23:50:08 1996 Jeffrey A Law (law@cygnus.com) + + * config/tc-v850.c (md_apply_fix3): Use little endian get/put + routines to fetch/store the updated instruction from/to memory. + (v850_insert_operand): If the operand has a specialized insert + routine, call it. + Fri Aug 30 18:35:26 1996 J.T. Conklin <jtc@hippo.cygnus.com> * config/tc-v850.c (reg_name_search): Align calling convention to diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index 8f56234..8024993 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -883,12 +883,16 @@ md_apply_fix3 (fixp, valuep, seg) operand = &v850_operands[opindex]; /* Fetch the instruction, insert the fully resolved operand - value, and stuff the instruction back again. */ + value, and stuff the instruction back again. + + Note the instruction has been stored in little endian + format! */ where = fixp->fx_frag->fr_literal + fixp->fx_where; - insn = bfd_getb32((unsigned char *) where); + + insn = bfd_getl32((unsigned char *) where); insn = v850_insert_operand (insn, operand, (offsetT) value, fixp->fx_file, fixp->fx_line); - bfd_putb32((bfd_vma) insn, (unsigned char *) where); + bfd_putl32((bfd_vma) insn, (unsigned char *) where); if (fixp->fx_done) { @@ -971,6 +975,19 @@ v850_insert_operand (insn, operand, val, file, line) } } - insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift); + if (operand->insert) + { + const char *message = NULL; + insn = (operand->insert) (insn, val, &message); + if (message != NULL) + { + if (file == (char *) NULL) + as_warn (message); + else + as_warn_where (file, line, message); + } + } + else + insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift); return insn; } |