From fb39dac1ef45db850a7647f4bf1da52ee5900543 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Fri, 26 Jul 2002 18:56:25 +0000 Subject: [PATCH] [bfd/] * 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 | 5 +++++ bfd/elfxx-mips.c | 9 +++++++++ ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-mips-elf/mips-elf.exp | 2 ++ ld/testsuite/ld-mips-elf/mips16-1.d | 5 +++++ ld/testsuite/ld-mips-elf/mips16-1a.s | 2 ++ ld/testsuite/ld-mips-elf/mips16-1b.s | 2 ++ 7 files changed, 31 insertions(+) create mode 100644 ld/testsuite/ld-mips-elf/mips16-1.d create mode 100644 ld/testsuite/ld-mips-elf/mips16-1a.s create mode 100644 ld/testsuite/ld-mips-elf/mips16-1b.s diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e513afc..284f275 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-07-26 Chris Demetriou + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE + flags into resulting BFD. + 2002-07-26 Alan Modra From John Reiser diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 3084885..78b3310 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -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) { diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 0cacce3..28d551e 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-07-26 Richard Sandiford + + * 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 * ld-mmix/sec-1.d: Adjust for changes in padding. diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index 798cb79..03f4e32 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -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 index 0000000..2b99668 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16-1.d @@ -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 index 0000000..a361a65 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16-1a.s @@ -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 index 0000000..11e36f7 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16-1b.s @@ -0,0 +1,2 @@ + .text +foo2: jr $31 -- 2.7.4