aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-08-09 10:40:04 +0000
committerNick Clifton <nickc@redhat.com>2013-08-09 10:40:04 +0000
commit4046d87a365240eed765f315f37b9bb64f208892 (patch)
treef33935fdd15080e3104e7614a7aefd403794c325 /bfd
parent1ed8d8006b916d7cda234df9660252545051c6fe (diff)
downloadgdb-4046d87a365240eed765f315f37b9bb64f208892.zip
gdb-4046d87a365240eed765f315f37b9bb64f208892.tar.gz
gdb-4046d87a365240eed765f315f37b9bb64f208892.tar.bz2
* 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 47e2e21..ccbc820 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 651a8bd..d18cc18 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;
}