diff options
author | DJ Delorie <dj@redhat.com> | 2013-02-27 21:39:20 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2013-02-27 21:39:20 +0000 |
commit | 4107ae2218c9a74fce40d50cb68a7a5ab0bf06e5 (patch) | |
tree | 62f49d1e3458b8b146fc11d65e04c100748fb956 /gas | |
parent | d50a0ce27329f5e07a889954e1a58396fcbd2b75 (diff) | |
download | gdb-4107ae2218c9a74fce40d50cb68a7a5ab0bf06e5.zip gdb-4107ae2218c9a74fce40d50cb68a7a5ab0bf06e5.tar.gz gdb-4107ae2218c9a74fce40d50cb68a7a5ab0bf06e5.tar.bz2 |
* reloc.c (BFD_RELOC_RL78_CODE): Add.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* elf32-rl78.c (rl78_elf_relocate_section): Handle weak code
references in compuated relocs.
* config/tc-rl78.c (reloc_function): Add %code -> BFD_RELOC_RL78_CODE.
(rl78_op): Handle %code().
(rl78_cons_fix_new): Likewise, but ignore for 20-bit operands.
(tc_gen_reloc): Likwise; convert to a computed reloc.
(md_apply_fix): Likewise.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/config/tc-rl78.c | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 0014922..a7f4709 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2013-02-27 DJ Delorie <dj@redhat.com> + + * config/tc-rl78.c (reloc_function): Add %code -> BFD_RELOC_RL78_CODE. + (rl78_op): Handle %code(). + (rl78_cons_fix_new): Likewise, but ignore for 20-bit operands. + (tc_gen_reloc): Likwise; convert to a computed reloc. + (md_apply_fix): Likewise. + 2013-02-25 Kaushik Phatak <Kaushik.Phatak@kpitcummins.com> * config/rl78-parse.y: Fix encoding of DIVWU insn. diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c index bd964dc..77a19bb 100644 --- a/gas/config/tc-rl78.c +++ b/gas/config/tc-rl78.c @@ -194,6 +194,9 @@ rl78_op (expressionS exp, int nbytes, int type) } else { + if (nbytes > 2 + && exp.X_md == BFD_RELOC_RL78_CODE) + exp.X_md = 0; rl78_op_fixup (exp, rl78_bytes.n_ops * 8, nbytes * 8, type); memset (rl78_bytes.ops + rl78_bytes.n_ops, 0, nbytes); rl78_bytes.n_ops += nbytes; @@ -337,6 +340,7 @@ static struct } reloc_functions[] = { + { "code", BFD_RELOC_RL78_CODE }, { "lo16", BFD_RELOC_RL78_LO16 }, { "hi16", BFD_RELOC_RL78_HI16 }, { "hi8", BFD_RELOC_RL78_HI8 }, @@ -556,6 +560,10 @@ rl78_cons_fix_new (fragS * frag, switch (exp->X_md) { + case BFD_RELOC_RL78_CODE: + if (size == 2) + type = exp->X_md; + break; case BFD_RELOC_RL78_LO16: case BFD_RELOC_RL78_HI16: if (size != 2) @@ -665,6 +673,11 @@ tc_gen_reloc (asection * seg ATTRIBUTE_UNUSED, fixS * fixp) OP (ABS32); break; + case BFD_RELOC_RL78_CODE: + SYM0 (); + OP (ABS16); + break; + case BFD_RELOC_RL78_LO16: SYM0 (); OPIMM (0xffff); @@ -771,6 +784,7 @@ md_apply_fix (struct fix * f ATTRIBUTE_UNUSED, case BFD_RELOC_16: case BFD_RELOC_16_PCREL: + case BFD_RELOC_RL78_CODE: op[0] = val; op[1] = val >> 8; break; |