diff options
author | Phil Blundell <philb@gnu.org> | 2000-10-27 22:39:05 +0000 |
---|---|---|
committer | Phil Blundell <philb@gnu.org> | 2000-10-27 22:39:05 +0000 |
commit | 5f4ce26d93f3ab6eb1f46eef54d091d18fd73549 (patch) | |
tree | e545b80d3ca460ad56eaa38371169a4e56e402e5 | |
parent | 16de4d8cf80a996d1eef4a40dc1687ae02e63404 (diff) | |
download | gdb-5f4ce26d93f3ab6eb1f46eef54d091d18fd73549.zip gdb-5f4ce26d93f3ab6eb1f46eef54d091d18fd73549.tar.gz gdb-5f4ce26d93f3ab6eb1f46eef54d091d18fd73549.tar.bz2 |
2000-10-27 Philip Blundell <philb@gnu.org>
* elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse
attempts to mix PIC code with non-PIC, just mark the output as
being position dependent.
(elf32_arm_merge_private_bfd_data): Likewise. Print an error
message for EF_SOFT_FLOAT mismatches. Display diagnostics for
all mismatches, not just the first one.
-rw-r--r-- | bfd/ChangeLog | 9 | ||||
-rw-r--r-- | bfd/elf32-arm.h | 52 |
2 files changed, 41 insertions, 20 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0ed7410..ac4808a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2000-10-27 Philip Blundell <philb@gnu.org> + + * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse + attempts to mix PIC code with non-PIC, just mark the output as + being position dependent. + (elf32_arm_merge_private_bfd_data): Likewise. Print an error + message for EF_SOFT_FLOAT mismatches. Display diagnostics for + all mismatches, not just the first one. + 2000-10-23 Philip Blundell <pb@futuretv.com> From 2000-05-23 H.J. Lu <hjl@gnu.org> diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index fd099b0..3ed64fe 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -1933,10 +1933,6 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) if (elf_flags_init (obfd) && in_flags != out_flags) { - /* Cannot mix PIC and non-PIC code. */ - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) - return false; - /* Cannot mix APCS26 and APCS32 code. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) return false; @@ -1956,6 +1952,10 @@ Warning: Clearing the interwork flag in %s because non-interworking code in %s h in_flags &= ~EF_INTERWORK; } + + /* Likewise for PIC, though don't warn for this case. */ + if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) + in_flags &= ~EF_PIC; } elf_elfheader (obfd)->e_flags = in_flags; @@ -1973,6 +1973,7 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) { flagword out_flags; flagword in_flags; + boolean flags_compatible = true; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -2024,48 +2025,59 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) return true; } - /* Check flag compatibility. */ + /* Identical flags must be compatible. */ if (in_flags == out_flags) return true; - /* Complain about various flag mismatches. */ + /* If any of the input BFDs is non-PIC, the output is also position + dependent. */ + if (!(in_flags & EF_PIC)) + elf_elfheader (obfd)->e_flags &= ~EF_PIC; + /* Complain about various flag mismatches. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) - _bfd_error_handler (_ ("\ + { + _bfd_error_handler (_ ("\ Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"), bfd_get_filename (ibfd), in_flags & EF_APCS_26 ? 26 : 32, bfd_get_filename (obfd), out_flags & EF_APCS_26 ? 26 : 32); + flags_compatible = false; + } if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) - _bfd_error_handler (_ ("\ + { + _bfd_error_handler (_ ("\ Error: %s passes floats in %s registers, whereas %s passes them in %s registers"), bfd_get_filename (ibfd), in_flags & EF_APCS_FLOAT ? _ ("float") : _ ("integer"), bfd_get_filename (obfd), out_flags & EF_APCS_26 ? _ ("float") : _ ("integer")); + flags_compatible = false; + } - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) - _bfd_error_handler (_ ("\ -Error: %s is compiled as position %s code, whereas %s is not"), - bfd_get_filename (ibfd), - in_flags & EF_PIC ? _ ("independent") : _ ("dependent"), - bfd_get_filename (obfd)); - - /* Interworking mismatch is only a warning. */ - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) + if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) { _bfd_error_handler (_ ("\ +Error: %s uses %s floating point, whereas %s uses %s floating point"), + bfd_get_filename (ibfd), + in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), + bfd_get_filename (obfd), + out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); + flags_compatible = false; + } + + /* Interworking mismatch is only a warning. */ + if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) + _bfd_error_handler (_ ("\ Warning: %s %s interworking, whereas %s %s"), bfd_get_filename (ibfd), in_flags & EF_INTERWORK ? _ ("supports") : _ ("does not support"), bfd_get_filename (obfd), out_flags & EF_INTERWORK ? _ ("does not") : _ ("does")); - return true; - } - return false; + return flags_compatible; } /* Display the flags field */ |