From fc91707cc23bf4d1cd75cc754c28cc4ff6b8c5bd Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 21 Nov 2007 12:06:26 +0000 Subject: * elf-m10300.c (mn10300_elf_relax_section): Allow for alignment relocs when computing whether instructions can be relaxed. * ld-mn10300/i135409-4.s: New test case. Check for relaxation to a 16-bit jump instruction. * ld-mn10300/i135409-4.t: Linker script for the new test. * ld-mn10300/i135409-4.d: Expected disassembly of new test. * ld-mn10300/mn10300.exp: Run the new test. --- ld/testsuite/ChangeLog | 8 ++++++++ ld/testsuite/ld-mn10300/i135409-4.d | 7 +++++++ ld/testsuite/ld-mn10300/i135409-4.s | 8 ++++++++ ld/testsuite/ld-mn10300/i135409-4.t | 23 +++++++++++++++++++++++ ld/testsuite/ld-mn10300/mn10300.exp | 8 ++++++++ 5 files changed, 54 insertions(+) create mode 100644 ld/testsuite/ld-mn10300/i135409-4.d create mode 100644 ld/testsuite/ld-mn10300/i135409-4.s create mode 100644 ld/testsuite/ld-mn10300/i135409-4.t (limited to 'ld') diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index da6d9b0..7e8719a 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2007-11-21 Nick Clifton + + * ld-mn10300/i135409-4.s: New test case. Check for relaxation to + a 16-bit jump instruction. + * ld-mn10300/i135409-4.t: Linker script for the new test. + * ld-mn10300/i135409-4.d: Expected disassembly of new test. + * ld-mn10300/mn10300.exp: Run the new test. + 2007-11-20 Nick Clifton * lib/ld-lib.exp (check_gc_sections_available): New proc, based diff --git a/ld/testsuite/ld-mn10300/i135409-4.d b/ld/testsuite/ld-mn10300/i135409-4.d new file mode 100644 index 0000000..f14ea7d --- /dev/null +++ b/ld/testsuite/ld-mn10300/i135409-4.d @@ -0,0 +1,7 @@ + +tmpdir/i135409-4.x: file format elf32-.* + +Disassembly of section .text: + +0+0 <_start>: + 0:[ ]+cc 00 07[ ]+jmp[ ]+700 \ diff --git a/ld/testsuite/ld-mn10300/i135409-4.s b/ld/testsuite/ld-mn10300/i135409-4.s new file mode 100644 index 0000000..90badde --- /dev/null +++ b/ld/testsuite/ld-mn10300/i135409-4.s @@ -0,0 +1,8 @@ + .text + .global _start +_start: + jmp L001 + + .section .text1 +L001: + nop diff --git a/ld/testsuite/ld-mn10300/i135409-4.t b/ld/testsuite/ld-mn10300/i135409-4.t new file mode 100644 index 0000000..9d905cb --- /dev/null +++ b/ld/testsuite/ld-mn10300/i135409-4.t @@ -0,0 +1,23 @@ +SECTIONS +{ + . = 0x0; + .text : + { + *(.text) + } + + . = 0x700; + .text1 : + { + *(.text1) + } + . = 0x8100; + .bss : + { + *(.bss) + } + .data : + { + *(.data) + } +} diff --git a/ld/testsuite/ld-mn10300/mn10300.exp b/ld/testsuite/ld-mn10300/mn10300.exp index a8128ed..f67881f 100644 --- a/ld/testsuite/ld-mn10300/mn10300.exp +++ b/ld/testsuite/ld-mn10300/mn10300.exp @@ -79,6 +79,14 @@ set mn10300_tests { { {objdump -d i135409-3.d} } "i135409-3.x" } + { + "adjusting a 16 bit branch" + "-Ti135409-4.t -relax" + "" + { "i135409-4.s" } + { {objdump -d i135409-4.d} } + "i135409-4.x" + } } run_ld_link_tests $mn10300_tests -- cgit v1.1