diff options
author | Nick Clifton <nickc@redhat.com> | 2003-04-01 13:08:06 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-04-01 13:08:06 +0000 |
commit | 5a6c681789fe44d0cfb3a3839aeb8a1060842c1f (patch) | |
tree | 71caa9c0f02720bfa21b4b77fcee77ef59cbdc22 /bfd/coff-arm.c | |
parent | 49634642a549784aaa0d26c1442a2580b697f49b (diff) | |
download | gdb-5a6c681789fe44d0cfb3a3839aeb8a1060842c1f.zip gdb-5a6c681789fe44d0cfb3a3839aeb8a1060842c1f.tar.gz gdb-5a6c681789fe44d0cfb3a3839aeb8a1060842c1f.tar.bz2 |
Fixes for iWMMXt contribution.
Diffstat (limited to 'bfd/coff-arm.c')
-rw-r--r-- | bfd/coff-arm.c | 66 |
1 files changed, 7 insertions, 59 deletions
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index 2401504..f089a6c 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -2240,25 +2240,6 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) if (ibfd == obfd) return TRUE; - if (bfd_get_mach (obfd) && bfd_get_mach (obfd) != bfd_get_mach (ibfd)) - { - /* For now, allow an output file type of 'xscale' if the - input file type is 'iWMMXt'. This means that we will - not have to build an entire iWMMXt enabled set of libraries - just to test a iWMMXt enabled binary. Change the output - type to iWMMXt though. Similarly allow 'xscale' binaries - to be linked into a 'iWMMXt' output binary. */ - if ( bfd_get_mach (obfd) == bfd_mach_arm_XScale - && bfd_get_mach (ibfd) == bfd_mach_arm_iWMMXt) - bfd_set_arch_mach (obfd, bfd_get_arch (obfd), bfd_mach_arm_iWMMXt); - else if ( bfd_get_mach (ibfd) != bfd_mach_arm_XScale - || bfd_get_mach (obfd) != bfd_mach_arm_iWMMXt) - { - bfd_set_error (bfd_error_wrong_format); - return FALSE; - } - } - /* If the two formats are different we cannot merge anything. This is not an error, since it is permissable to change the input and output formats. */ @@ -2266,7 +2247,12 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) || obfd->xvec->flavour != bfd_target_coff_flavour) return TRUE; - /* Verify that the APCS is the same for the two BFDs */ + /* Determine what should happen if the input ARM architecture + does not match the output ARM architecture. */ + if (! bfd_arm_merge_machines (ibfd, obfd)) + return FALSE; + + /* Verify that the APCS is the same for the two BFDs. */ if (APCS_SET (ibfd)) { if (APCS_SET (obfd)) @@ -2603,45 +2589,7 @@ coff_arm_final_link_postscript (abfd, pfinfo) globals->bfd_of_glue_owner->output_has_begun = TRUE; } - { - asection * arm_arch_section; - - /* Look for a .note section. If one is present check - the machine number encoded in it, and set it to the current - machine number if it is different. This allows XScale and - iWMMXt binaries to be merged and the resulting output to be set - to iWMMXt, even if the first input file had an XScale .note. */ - - arm_arch_section = bfd_get_section_by_name (abfd, ".note"); - - if (arm_arch_section != NULL) - { - char buffer [4]; - - if (bfd_get_section_contents (abfd, arm_arch_section, buffer, - (file_ptr) 0, sizeof buffer)) - { - unsigned long arm_mach; - - /* We have to extract the value this way to allow for a - host whose endian-ness is different from the target. */ - arm_mach = bfd_get_32 (abfd, buffer); - - if (arm_mach != bfd_get_mach (abfd)) - { - bfd_put_32 (abfd, bfd_get_mach (abfd), buffer); - - if (! bfd_set_section_contents (abfd, arm_arch_section, buffer, - (file_ptr) 0, sizeof buffer)) - (*_bfd_error_handler) - (_("warning: unable to update contents of .note section in %s"), - bfd_get_filename (abfd)); - } - } - } - } - - return TRUE; + return bfd_arm_update_notes (abfd, ARM_NOTE_SECTION); } #include "coffcode.h" |