diff options
author | Nick Clifton <nickc@redhat.com> | 2007-11-13 10:40:29 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2007-11-13 10:40:29 +0000 |
commit | b5f5fd962ef368674d3460bf78a9c6d13a2ab72b (patch) | |
tree | e438575a95064274620cb1ef22c617a4b5b8d145 /ld/testsuite/ld-mn10300 | |
parent | 0067a5693ac40531a6975777c7b6c3b40fd8795e (diff) | |
download | gdb-b5f5fd962ef368674d3460bf78a9c6d13a2ab72b.zip gdb-b5f5fd962ef368674d3460bf78a9c6d13a2ab72b.tar.gz gdb-b5f5fd962ef368674d3460bf78a9c6d13a2ab72b.tar.bz2 |
* config/tc-mn10300.c (mn10300_force_relocation): Force a reloc to be generated for alignment fixups.
* config/tc-mn10300.h (TC_FORCE_RELOCATION): Call mn10300_force_relocation.
* elf-m10300.c (mn10300_elf_final_link_relocate): Prevent the accidental termination of DWARF location list entries.
(mn10300_elf_relax_delete_bytes): Stop deletion if an align reloc is encountered that is larger than or not a mutliple of the number of bytes being deleted.
When adjusting symbols, any symbols inside the region being deleted must be moved to the end of the region.
Move align relocs forward if there is room for them after the deletion of the region.
Diffstat (limited to 'ld/testsuite/ld-mn10300')
-rw-r--r-- | ld/testsuite/ld-mn10300/i127740.d | 17 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i127740.s | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i135409-3.d | 16 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i135409-3.s | 16 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/mn10300.exp | 16 |
5 files changed, 77 insertions, 0 deletions
diff --git a/ld/testsuite/ld-mn10300/i127740.d b/ld/testsuite/ld-mn10300/i127740.d new file mode 100644 index 0000000..456a75b --- /dev/null +++ b/ld/testsuite/ld-mn10300/i127740.d @@ -0,0 +1,17 @@ + +tmpdir/i127740.x: file format elf32-.* + +Disassembly of section .text: + +0+0100 <_main>: + 100: 2d 00 03[ ]+mov 768,d1 + 103: cb[ ]+nop + 104: cb[ ]+nop + 105: cb[ ]+nop + ... + +0+0200 <_dummy>: + 200: 00[ ]+clr d0 + 201: 02 00 00[ ]+movbu d0,\(0 <_main-0x100>\) + 204: df 00 00[ ]+ret \[\],0 + ... diff --git a/ld/testsuite/ld-mn10300/i127740.s b/ld/testsuite/ld-mn10300/i127740.s new file mode 100644 index 0000000..358266b --- /dev/null +++ b/ld/testsuite/ld-mn10300/i127740.s @@ -0,0 +1,12 @@ + .section .text + .global _main + .global _dummy +_main: + mov _g_label,d1 # instruction is changed by relaxations + + .balign 0x100 +_dummy: + .long _dummy + ret [],0 + .size _main, .-_main + .comm _g_label,4,4 diff --git a/ld/testsuite/ld-mn10300/i135409-3.d b/ld/testsuite/ld-mn10300/i135409-3.d new file mode 100644 index 0000000..1ea91ba --- /dev/null +++ b/ld/testsuite/ld-mn10300/i135409-3.d @@ -0,0 +1,16 @@ + +tmpdir/i135409-3.x: file format elf32-.* + +Disassembly of section .text: + +0+0 <_func>: + 0: 25 1f 00[ ]+mov 31,a1 + 3: cb[ ]+nop + +0+04 <A>: + 4: 25 1f 00[ ]+mov 31,a1 + 7: cb[ ]+nop + +0+08 <BOTTOM>: + 8: e1[ ]+add d0,d1 +#pass diff --git a/ld/testsuite/ld-mn10300/i135409-3.s b/ld/testsuite/ld-mn10300/i135409-3.s new file mode 100644 index 0000000..e83ad96 --- /dev/null +++ b/ld/testsuite/ld-mn10300/i135409-3.s @@ -0,0 +1,16 @@ + .text + .global _start +_start: + .type _func, @function +_func: + mov L001,A1 + nop +A: + mov L001,A1 +BOTTOM: + .balign 0x8 + add D0,D1 + .size _func, .-func + + .data +L001: diff --git a/ld/testsuite/ld-mn10300/mn10300.exp b/ld/testsuite/ld-mn10300/mn10300.exp index 18bbad3..232a5fb 100644 --- a/ld/testsuite/ld-mn10300/mn10300.exp +++ b/ld/testsuite/ld-mn10300/mn10300.exp @@ -48,6 +48,14 @@ set mn10300_tests { "i112045-3.x" } { + "relaxation and alignment directives" + "-relax -Ttext 100" + "" + { "i127740.s" } + { {objdump -d i127740.d} } + "i127740.x" + } + { "adjustment of symbols due to relaxation" "-Tdata 1f -Ttext 0 -relax" "" @@ -63,6 +71,14 @@ set mn10300_tests { { {readelf --syms i135409-2.d} } "i135409-2.x" } + { + "adjustment of symbols due to relaxation (with a symbol in the deleted region)" + "-Tdata 1f -Ttext 0 -relax" + "" + { "i135409-3.s" } + { {objdump -d i135409-3.d} } + "i135409-3.x" + } } run_ld_link_tests $mn10300_tests |