summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-rl78.c25
-rw-r--r--include/elf/ChangeLog4
-rw-r--r--include/elf/rl78.h5
4 files changed, 36 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 47e2e215cf1..ccbc820909f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-09 Nick Clifton <nickc@redhat.com>
+
+ * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if G10
+ flag bits do not match.
+ (rl78_elf_print_private_bfd_data): Describe G10 flag.
+
2013-08-05 John Tytgat <john@bass-software.com>
* po/BLD-POTFILES.in: Regenerate.
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index 651a8bdce69..d18cc184ded 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -1,6 +1,5 @@
/* Renesas RL78 specific support for 32-bit ELF.
- Copyright (C) 2011, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -1021,9 +1020,11 @@ static bfd_boolean
rl78_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
{
flagword new_flags;
+ flagword old_flags;
bfd_boolean error = FALSE;
new_flags = elf_elfheader (ibfd)->e_flags;
+ old_flags = elf_elfheader (obfd)->e_flags;
if (!elf_flags_init (obfd))
{
@@ -1031,6 +1032,23 @@ rl78_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
elf_flags_init (obfd) = TRUE;
elf_elfheader (obfd)->e_flags = new_flags;
}
+ else if (old_flags != new_flags)
+ {
+ flagword changed_flags = old_flags ^ new_flags;
+
+ if (changed_flags & E_FLAG_RL78_G10)
+ {
+ (*_bfd_error_handler)
+ (_("RL78/G10 ABI conflict: cannot link G10 and non-G10 objects together"));
+
+ if (old_flags & E_FLAG_RL78_G10)
+ (*_bfd_error_handler) (_("- %s is G10, %s is not"),
+ bfd_get_filename (obfd), bfd_get_filename (ibfd));
+ else
+ (*_bfd_error_handler) (_("- %s is G10, %s is not"),
+ bfd_get_filename (ibfd), bfd_get_filename (obfd));
+ }
+ }
return !error;
}
@@ -1049,6 +1067,9 @@ rl78_elf_print_private_bfd_data (bfd * abfd, void * ptr)
flags = elf_elfheader (abfd)->e_flags;
fprintf (file, _("private flags = 0x%lx:"), (long) flags);
+ if (flags & E_FLAG_RL78_G10)
+ fprintf (file, _(" [G10]"));
+
fputc ('\n', file);
return TRUE;
}
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 8445e61bf49..2b694825295 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,7 @@
+2013-08-09 Nick Clifton <nickc@redhat.com>
+
+ * rl78.c (E_FLAG_RL78_G10): Define.
+
2013-07-15 Maciej W. Rozycki <macro@codesourcery.com>
* mips.h (Tag_GNU_MIPS_ABI_FP): Remove comment.
diff --git a/include/elf/rl78.h b/include/elf/rl78.h
index 82959e14980..b281d3af6dc 100644
--- a/include/elf/rl78.h
+++ b/include/elf/rl78.h
@@ -1,5 +1,5 @@
/* RL78 ELF support for BFD.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -104,8 +104,9 @@ END_RELOC_NUMBERS (R_RL78_max)
#define EF_RL78_ALL_FLAGS (EF_RL78_CPU_MASK)
/* Values for the e_flags field in the ELF header. */
-#define E_FLAG_RL78_64BIT_DOUBLES (1 << 0)
+#define E_FLAG_RL78_64BIT_DOUBLES (1 << 0)
#define E_FLAG_RL78_DSP (1 << 1) /* Defined in the RL78 CPU Object file specification, but not explained. */
+#define E_FLAG_RL78_G10 (1 << 2) /* CPU is missing register banks 1-3, so uses different ABI. */
/* These define the addend field of R_RL78_RH_RELAX relocations. */
#define RL78_RELAXA_BRA 0x00000010 /* Any type of branch (must be decoded). */