summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-08-09 10:40:03 +0000
committerNick Clifton <nickc@redhat.com>2013-08-09 10:40:03 +0000
commitb8cee39d75eebcf6175a210cf878d3e1f4825870 (patch)
tree170adefbe0f68a2b4f96c3876b04a872213f9df3 /bfd
parente409c1376cf2e61535e3c7e6b2c9b38f6b25248d (diff)
downloadbinutils-redhat-b8cee39d75eebcf6175a210cf878d3e1f4825870.tar.gz
* 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. * readelf.c (get_machine_flags): Handle RL78 G10 flag. * config/tc-rl78.c (elf_flags): New variable. (enum options): Add OPTION_G10. (md_longopts): Add mg10. (md_parse_option): Parse -mg10. (rl78_elf_final_processing): New function. * config/tc-rl78.c (tc_final_processing): Define. * doc/c-rl78.texi: Document -mg10 option. * rl78.c (E_FLAG_RL78_G10): Define. * lib/ld-lib.exp (check_shared_lib_support): Note that the RL78 does not support shared library generation.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-rl78.c25
2 files changed, 29 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 47e2e215cf..ccbc820909 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 651a8bdce6..d18cc184de 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;
}