diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-rl78.c | 25 |
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; } |