From: nobody <> Date: Tue, 26 Feb 2002 22:17:57 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'binutils- X-Git-Tag: binutils-2_12~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04f7c5ec17b4c882e565ee233604a5047faef52d;p=thirdparty%2Fbinutils-gdb.git This commit was manufactured by cvs2svn to create branch 'binutils- 2_12-branch'. Cherrypick from master 2002-02-26 22:17:56 UTC Chris Demetriou '2002-02-26 Chris Demetriou ': gas/testsuite/gas/mips/jal-empic-elf-2.d gas/testsuite/gas/mips/jal-empic-elf-2.s gas/testsuite/gas/mips/jal-empic-elf-3.d gas/testsuite/gas/mips/jal-empic-elf-3.s gas/testsuite/gas/mips/jal-empic-elf.d --- diff --git a/gas/testsuite/gas/mips/jal-empic-elf-2.d b/gas/testsuite/gas/mips/jal-empic-elf-2.d new file mode 100644 index 00000000000..3571dd4d232 --- /dev/null +++ b/gas/testsuite/gas/mips/jal-empic-elf-2.d @@ -0,0 +1,48 @@ +#objdump: -dr --prefix-addresses -mmips:3000 --show-raw-insn +#name: MIPS jal-empic-elf-2 +#as: -mips1 -membedded-pic + +# Test the jal macro harder with -membedded-pic. + +.*: +file format .*mips.* + +Disassembly of section .text: + \.\.\. + \.\.\. +0+0018 <[^>]*> 04110002 bal 0+0024 +[ ]*18: R_MIPS_GNU_REL16_S2 .text +0+001c <[^>]*> 00000000 nop +0+0020 <[^>]*> 04110002 bal 0+002c +[ ]*20: R_MIPS_GNU_REL16_S2 .text +0+0024 <[^>]*> 00000000 nop +0+0028 <[^>]*> 0411ffff bal 0+0028 +[ ]*28: R_MIPS_GNU_REL16_S2 e1 +0+002c <[^>]*> 00000000 nop +0+0030 <[^>]*> 10000002 b 0+003c +[ ]*30: R_MIPS_GNU_REL16_S2 .text +0+0034 <[^>]*> 00000000 nop +0+0038 <[^>]*> 10000002 b 0+0044 +[ ]*38: R_MIPS_GNU_REL16_S2 .text +0+003c <[^>]*> 00000000 nop +0+0040 <[^>]*> 1000ffff b 0+0040 +[ ]*40: R_MIPS_GNU_REL16_S2 e1 +0+0044 <[^>]*> 00000000 nop +0+0048 <[^>]*> 0411ffff bal 0+0048 +[ ]*48: R_MIPS_GNU_REL16_S2 .text +0+004c <[^>]*> 00000000 nop +0+0050 <[^>]*> 0411ffff bal 0+0050 +[ ]*50: R_MIPS_GNU_REL16_S2 .text +0+0054 <[^>]*> 00000000 nop +0+0058 <[^>]*> 0411fffc bal 0+004c +[ ]*58: R_MIPS_GNU_REL16_S2 e1 +0+005c <[^>]*> 00000000 nop +0+0060 <[^>]*> 04110005 bal 0+0078 +[ ]*60: R_MIPS_GNU_REL16_S2 .text +0+0064 <[^>]*> 00000000 nop +0+0068 <[^>]*> 04110005 bal 0+0080 +[ ]*68: R_MIPS_GNU_REL16_S2 .text +0+006c <[^>]*> 00000000 nop +0+0070 <[^>]*> 04110002 bal 0+007c +[ ]*70: R_MIPS_GNU_REL16_S2 e1 +0+0074 <[^>]*> 00000000 nop + \.\.\. diff --git a/gas/testsuite/gas/mips/jal-empic-elf-2.s b/gas/testsuite/gas/mips/jal-empic-elf-2.s new file mode 100644 index 00000000000..3a175552761 --- /dev/null +++ b/gas/testsuite/gas/mips/jal-empic-elf-2.s @@ -0,0 +1,28 @@ +# Source file used to test the jal macro even harder + # some space so offets won't be 0. + .space 0xc + + .globl g1 .text +g1: +l1: + # some more space, so offset from label won't be 0. + .space 0xc + + jal g1 # 0x18 + jal l1 # 0x20 + jal e1 # 0x28 + + j g1 # 0x30 + j l1 # 0x38 + j e1 # 0x40 + + jal g1 - 0xc # 0x48 + jal l1 - 0xc # 0x50 + jal e1 - 0xc # 0x58 + + jal g1 + 0xc # 0x60 + jal l1 + 0xc # 0x68 + jal e1 + 0xc # 0x70 + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff --git a/gas/testsuite/gas/mips/jal-empic-elf-3.d b/gas/testsuite/gas/mips/jal-empic-elf-3.d new file mode 100644 index 00000000000..c3647d3a667 --- /dev/null +++ b/gas/testsuite/gas/mips/jal-empic-elf-3.d @@ -0,0 +1,24 @@ +#objdump: -dr --prefix-addresses -mmips:3000 --show-raw-insn +#name: MIPS jal-empic-elf-3 +#as: -mips1 -membedded-pic + +# Test the jal macro harder with -membedded-pic. + +.*: +file format .*mips.* + +Disassembly of section .text: + \.\.\. + \.\.\. +0+0018 <[^>]*> 0411fffa bal 0+0004 +[ ]*18: R_MIPS_GNU_REL16_S2 .text +0+001c <[^>]*> 00000000 nop +0+0020 <[^>]*> 0411fff8 bal 0+0004 +[ ]*20: R_MIPS_GNU_REL16_S2 .text +0+0024 <[^>]*> 00000000 nop +0+0028 <[^>]*> 0411fff6 bal 0+0004 +[ ]*28: R_MIPS_GNU_REL16_S2 e1 +0+002c <[^>]*> 00000000 nop +0+0030 <[^>]*> 0411fff4 bal 0+0004 +[ ]*30: R_MIPS_GNU_REL16_S2 e2 +0+0034 <[^>]*> 00000000 nop + \.\.\. diff --git a/gas/testsuite/gas/mips/jal-empic-elf-3.s b/gas/testsuite/gas/mips/jal-empic-elf-3.s new file mode 100644 index 00000000000..7043d527f8d --- /dev/null +++ b/gas/testsuite/gas/mips/jal-empic-elf-3.s @@ -0,0 +1,20 @@ +# Source file used to test the jal macro even harder + # some space so offets won't be 0. + .space 0xc + + .globl g1 .text + .globl e2 .text +g1: +l1: + # some more space, so offset from label won't be 0. + .space 0xc + + # Hit the case where 'value == 0' in the BFD_RELOC_16_PCREL_S2 + # handling in tc-mips.c:md_apply_fix3(). + jal g1 - 0x20 # 0x18 + jal l1 - 0x28 # 0x20 + jal e1 - 0x24 # 0x28 + jal e2 - 0x2c # 0x30 + +# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... + .space 8 diff --git a/gas/testsuite/gas/mips/jal-empic-elf.d b/gas/testsuite/gas/mips/jal-empic-elf.d new file mode 100644 index 00000000000..d46a52f2b66 --- /dev/null +++ b/gas/testsuite/gas/mips/jal-empic-elf.d @@ -0,0 +1,26 @@ +#objdump: -dr --prefix-addresses -mmips:3000 --show-raw-insn +#name: MIPS jal-empic-elf +#as: -mips1 -membedded-pic +#source: jal.s + +# Test the jal macro with -membedded-pic. + +.*: +file format .*mips.* + +Disassembly of section .text: +0+0000 <[^>]*> 0320f809 jalr t9 +0+0004 <[^>]*> 00000000 nop +0+0008 <[^>]*> 03202009 jalr a0,t9 +0+000c <[^>]*> 00000000 nop +0+0010 <[^>]*> 0411ffff bal 0+0010 +[ ]*10: R_MIPS_GNU_REL16_S2 .text +0+0014 <[^>]*> 00000000 nop +0+0018 <[^>]*> 0411ffff bal 0+0018 +[ ]*18: R_MIPS_GNU_REL16_S2 external_text_label +0+001c <[^>]*> 00000000 nop +0+0020 <[^>]*> 1000ffff b 0+0020 +[ ]*20: R_MIPS_GNU_REL16_S2 .text +0+0024 <[^>]*> 00000000 nop +0+0028 <[^>]*> 1000ffff b 0+0028 +[ ]*28: R_MIPS_GNU_REL16_S2 external_text_label +0+002c <[^>]*> 00000000 nop