summaryrefslogtreecommitdiff
path: root/bfd/elf32-rl78.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-rl78.c')
-rw-r--r--bfd/elf32-rl78.c25
1 files changed, 23 insertions, 2 deletions
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;
}