aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-04-14 16:23:33 +0100
committerNick Clifton <nickc@redhat.com>2015-04-14 16:23:33 +0100
commit6ff71e768112317de1236a429e7c88c9d3e32116 (patch)
tree3d24e09232efe594ec6a32482a95b2f161250e4e /binutils
parent9e811bc379ef78f0e2beadda9ed3ce6679ded7ea (diff)
downloadgdb-6ff71e768112317de1236a429e7c88c9d3e32116.zip
gdb-6ff71e768112317de1236a429e7c88c9d3e32116.tar.gz
gdb-6ff71e768112317de1236a429e7c88c9d3e32116.tar.bz2
Adds support to the RL78 port for linker relaxation affecting .debug sections.
gas * config/tc-rl78.h (TC_LINKRELAX_FIXUP): Define. (TC_FORCE_RELOCATION_SUB_SAME): Define. (DWARF2_USE_FIXED_ADVANCE_PC): Define. * gas/lns/lns.exp: Add RL78 to list of targets using DW_LNS_fixed_advance_pc. bfd * elf32-rl78.c (RL78_OP_REL): New macro. (rl78_elf_howto_table): Use it for complex relocs. (get_symbol_value): Handle the cases when the info or status arguments are NULL. (get_romstart): Cache the status returned by get_symbol_value. (get_ramstart): Likewise. (RL78_STACK_PUSH): Generate an error message if the stack overflows. (RL78_STACK_POP): Likewise for underflows. (rl78_compute_complex_reloc): New function. Contains the basic processing code for all RL78 complex relocs. (rl78_special_reloc): New function. Provides special reloc handling for complex relocs. (rl78_elf_relocate_section): Use rl78_compute_complex_reloc. (rl78_offset_for_reloc): Likewise. binutils* readelf.c (target_specific_reloc_handling): Add code to handle RL78 complex relocs.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c36
2 files changed, 41 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 31eb7a3..717533f 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-14 Nick Clifton <nickc@redhat.com>
+
+ * readelf.c (target_specific_reloc_handling): Add code to handle
+ RL78 complex relocs.
+
2015-04-13 Doug Evans <dje@google.com>
PR binutils/18218
diff --git a/binutils/readelf.c b/binutils/readelf.c
index ca25136..1533806 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -11161,6 +11161,42 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
}
break;
}
+
+ case EM_RL78:
+ {
+ static bfd_vma saved_sym1 = 0;
+ static bfd_vma saved_sym2 = 0;
+ static bfd_vma value;
+
+ switch (reloc_type)
+ {
+ case 0x80: /* R_RL78_SYM. */
+ saved_sym1 = saved_sym2;
+ saved_sym2 = symtab[get_reloc_symindex (reloc->r_info)].st_value;
+ saved_sym2 += reloc->r_addend;
+ return TRUE;
+
+ case 0x83: /* R_RL78_OPsub. */
+ value = saved_sym1 - saved_sym2;
+ saved_sym2 = saved_sym1 = 0;
+ return TRUE;
+ break;
+
+ case 0x41: /* R_RL78_ABS32. */
+ byte_put (start + reloc->r_offset, value, 4);
+ value = 0;
+ return TRUE;
+
+ case 0x43: /* R_RL78_ABS16. */
+ byte_put (start + reloc->r_offset, value, 2);
+ value = 0;
+ return TRUE;
+
+ default:
+ break;
+ }
+ break;
+ }
}
return FALSE;