[bfd/]
authorRichard Sandiford <rdsandiford@googlemail.com>
Fri, 26 Jul 2002 18:56:25 +0000 (18:56 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Fri, 26 Jul 2002 18:56:25 +0000 (18:56 +0000)
* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE
flags into resulting BFD.

[ld/testsuite/]
* ld-mips-elf/mips16-1.d,
* ld-mips-elf/mips16-1[ab].s: New test.
* ld-mips-elf/mips-elf.exp: Run it.

bfd/ChangeLog
bfd/elfxx-mips.c
ld/testsuite/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/mips16-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-1a.s [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips16-1b.s [new file with mode: 0644]

index e513afc32356e237b7ba15a25582d7615643b8ce..284f2755d7d2f80ddfdc70d71ff3cba38df7a7aa 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-26  Chris Demetriou  <cgd@broadcom.com>
+
+       * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE
+       flags into resulting BFD.
+
 2002-07-26  Alan Modra  <amodra@bigpond.net.au>
 
        From John Reiser <jreiser@BitWagon.com>
index 3084885d9260adadf793a913f51eb7be7b496170..78b331053e3a0f66ed38f502dfd28ce3366150de 100644 (file)
@@ -7803,6 +7803,15 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
       old_flags &= ~EF_MIPS_ABI;
     }
 
+  /* For now, allow arbitrary mixing of ASEs (retain the union).  */
+  if ((new_flags & EF_MIPS_ARCH_ASE) != (old_flags & EF_MIPS_ARCH_ASE))
+    {
+      elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_ARCH_ASE;
+
+      new_flags &= ~ EF_MIPS_ARCH_ASE;
+      old_flags &= ~ EF_MIPS_ARCH_ASE;
+    }
+
   /* Warn about any other mismatches */
   if (new_flags != old_flags)
     {
index 0cacce34220c307bbb7d0bb9ff630873f28dc074..28d551e9d886cc7a37031c9187b259e53c21f13f 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-26  Richard Sandiford  <rsandifo@redhat.com>
+
+       * ld-mips-elf/mips16-1.d,
+       * ld-mips-elf/mips16-1[ab].s: New test.
+       * ld-mips-elf/mips-elf.exp: Run it.
+
 2002-07-19  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * ld-mmix/sec-1.d: Adjust for changes in padding.
index 798cb79c0410fba2eecaec823b4c8789a87a63b1..03f4e32cad963eb16c808453323565695346247e 100644 (file)
@@ -39,6 +39,8 @@ if { [istarget mips*-*-*] } then {
        run_dump_test "emrelocs-eb"
        run_dump_test "emrelocs-el"
 
+       run_dump_test "mips16-1"
+
        run_dump_test "region1"
     }
 }
diff --git a/ld/testsuite/ld-mips-elf/mips16-1.d b/ld/testsuite/ld-mips-elf/mips16-1.d
new file mode 100644 (file)
index 0000000..2b99668
--- /dev/null
@@ -0,0 +1,5 @@
+#source: mips16-1a.s -no-mips16
+#source: mips16-1b.s -mips16
+#ld: -r
+#objdump: -d
+#pass
diff --git a/ld/testsuite/ld-mips-elf/mips16-1a.s b/ld/testsuite/ld-mips-elf/mips16-1a.s
new file mode 100644 (file)
index 0000000..a361a65
--- /dev/null
@@ -0,0 +1,2 @@
+       .text
+foo1:  jr $31
diff --git a/ld/testsuite/ld-mips-elf/mips16-1b.s b/ld/testsuite/ld-mips-elf/mips16-1b.s
new file mode 100644 (file)
index 0000000..11e36f7
--- /dev/null
@@ -0,0 +1,2 @@
+       .text
+foo2:  jr $31