diff options
author | Nick Clifton <nickc@redhat.com> | 2007-10-30 15:18:29 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2007-10-30 15:18:29 +0000 |
commit | 569006e5824adcb39d114e815712b7aa3f5e136c (patch) | |
tree | 327248411133c3dd62a95c7ff69c33935c168e0f /ld | |
parent | 4e188d170a4a1c89ab9969c638a0bf5490d27984 (diff) | |
download | gdb-569006e5824adcb39d114e815712b7aa3f5e136c.zip gdb-569006e5824adcb39d114e815712b7aa3f5e136c.tar.gz gdb-569006e5824adcb39d114e815712b7aa3f5e136c.tar.bz2 |
* mn10300.h (R_MN10300_ALIGN): Define.
* reloc.c (BFD_RELOC_MN10300_ALIGN): Add.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* elf-m10300.h: Handle R_MN10300_ALIGN relocs.
* mn10300_elf_relax_delete_bytes): Honour R_MN10300_ALIGN relocs.
Re-fix off by one error in comparisons.
* config/tc-mn10300.c (tc_gen_reloc): Fix test that decides when
sym_diff relocs should be generated.
(md_apply_fix): Skip R_MN10300_ALIGN relocs.
(mn10300_fix_adjustable): Do not adjust R_MN10300_ALIGN relocs.
(mn10300_handle_align): New function. Generate R_MN10300_ALIGN
relocs to record alignment requests.
* config/tc-mn10300.h (TC_FORCE_RELOCATION_SUB_SAME): Also force
R_MN10300_ALIGN relocs.
(HANDLE_ALIGN): Define. Call mn10300_handle_align.
* gas/all/gas.exp: Do not run diff1.s test for mn10300.
* ld-mn10300/mn10300.exp: Run new tests. Skip i126256 test if
a compiler is not available.
* ld-mn10300/i112045-3.s: New test.
* ld-mn10300/i112045-3.d: Expected disassembly.
* ld-mn10300/i135409.s: Rename to i135409-1.s.
* ld-mn10300/i135409.d: Rename to i135409-1.d
* ld-mn10300/i135409-2.s: New test.
* ld-mn10300/i135409-2.d: Expected symbol table.
* ld-mn10300/i36434.d: Adjust expected disassembly.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i112045-3.d | 17 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i112045-3.s | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i135409-1.d (renamed from ld/testsuite/ld-mn10300/i135409.d) | 0 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i135409-1.s (renamed from ld/testsuite/ld-mn10300/i135409.s) | 0 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i135409-2.d | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i135409-2.s | 23 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/i36434.d | 20 | ||||
-rw-r--r-- | ld/testsuite/ld-mn10300/mn10300.exp | 55 |
9 files changed, 126 insertions, 23 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index b6d136a..49e55ad 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2007-10-30 Nick Clifton <nickc@redhat.com> + + * ld-mn10300/mn10300.exp: Run new tests. Skip i126256 test if + a compiler is not available. + * ld-mn10300/i112045-3.s: New test. + * ld-mn10300/i112045-3.d: Expected disassembly. + * ld-mn10300/i135409.s: Rename to i135409-1.s. + * ld-mn10300/i135409.d: Rename to i135409-1.d + * ld-mn10300/i135409-2.s: New test. + * ld-mn10300/i135409-2.d: Expected symbol table. + * ld-mn10300/i36434.d: Adjust expected disassembly. + 2007-10-26 Alan Modra <amodra@bigpond.net.au> * ld-scripts/rgn-over1.d: Accept extra LOAD at end of map file. diff --git a/ld/testsuite/ld-mn10300/i112045-3.d b/ld/testsuite/ld-mn10300/i112045-3.d new file mode 100644 index 0000000..c4b2f4b --- /dev/null +++ b/ld/testsuite/ld-mn10300/i112045-3.d @@ -0,0 +1,17 @@ + +tmpdir/i112045-3.x: file format elf32-.* + +Disassembly of section .text: + +0+0100 <L001>: + 100:[ ]+24 00 01[ ]+mov[ ]+256,a0 + +0+0103 <L002>: + 103:[ ]+24 00 01[ ]+mov[ ]+256,a0 +Disassembly of section .rodata: + +0+0106 <L004>: + 106:[ ]+06 00 00[ ]+movbu[ ]+d1,\(0 <L001-0x100>\) + 109:[ ]+00[ ]+clr[ ]+d0 + 10a:[ ]+03 00 00[ ]+movhu[ ]+d0,\(0 <L001-0x100>\) +[ ]+... diff --git a/ld/testsuite/ld-mn10300/i112045-3.s b/ld/testsuite/ld-mn10300/i112045-3.s new file mode 100644 index 0000000..b372a77 --- /dev/null +++ b/ld/testsuite/ld-mn10300/i112045-3.s @@ -0,0 +1,11 @@ + .text +L001: + mov L001,A0 +L002: + mov L001,A0 +L003: + + .section .rodata +L004: + .long L003-L001 + .long L003-L002 diff --git a/ld/testsuite/ld-mn10300/i135409.d b/ld/testsuite/ld-mn10300/i135409-1.d index 2d64a42..2d64a42 100644 --- a/ld/testsuite/ld-mn10300/i135409.d +++ b/ld/testsuite/ld-mn10300/i135409-1.d diff --git a/ld/testsuite/ld-mn10300/i135409.s b/ld/testsuite/ld-mn10300/i135409-1.s index b9faaf4..b9faaf4 100644 --- a/ld/testsuite/ld-mn10300/i135409.s +++ b/ld/testsuite/ld-mn10300/i135409-1.s diff --git a/ld/testsuite/ld-mn10300/i135409-2.d b/ld/testsuite/ld-mn10300/i135409-2.d new file mode 100644 index 0000000..59c07e3 --- /dev/null +++ b/ld/testsuite/ld-mn10300/i135409-2.d @@ -0,0 +1,11 @@ + +Symbol table '.symtab' contains .. entries: + Num: Value Size Type Bind Vis Ndx Name +#... + ..: 0[0-9a-f]+02[ ]+0 NOTYPE LOCAL DEFAULT . _A + ..: 0[0-9a-f]+08[ ]+0 NOTYPE LOCAL DEFAULT . _B + ..: 0[0-9a-f]+08[ ]+0 NOTYPE LOCAL DEFAULT . _C + ..: 0[0-9a-f]+10[ ]+7 FUNC LOCAL DEFAULT . _func + ..: 0[0-9a-f]+14[ ]+0 NOTYPE LOCAL DEFAULT . _D + ..: 0[0-9a-f]+17[ ]+0 NOTYPE LOCAL DEFAULT . BOTTOM +#pass diff --git a/ld/testsuite/ld-mn10300/i135409-2.s b/ld/testsuite/ld-mn10300/i135409-2.s new file mode 100644 index 0000000..36448ed --- /dev/null +++ b/ld/testsuite/ld-mn10300/i135409-2.s @@ -0,0 +1,23 @@ + .text + .global _start +_start: + add A0, A1 +_A: + mov L001, A0 +_B: + .balign 0x8 +_C: + nop + .balign 0x10 + + .type _func, @function +_func: + mov L001, A1 + nop +_D: + mov L001, A1 +BOTTOM: + .size _func, . - _func + + .data +L001: diff --git a/ld/testsuite/ld-mn10300/i36434.d b/ld/testsuite/ld-mn10300/i36434.d index 25cea45..af37b3b 100644 --- a/ld/testsuite/ld-mn10300/i36434.d +++ b/ld/testsuite/ld-mn10300/i36434.d @@ -3,14 +3,14 @@ tmpdir/i36434.x: file format elf32-.* Disassembly of section .text: -08000000 <_start>: - 8000000: fc cd 18 80 mov 134250520,d1 - 8000004: 00 08 - 8000006: cb nop +08000074 <_start>: + 8000074: fc cd 8c 80 mov 134250636,d1 + 8000078: 00 08 + 800007a: cb nop -08000007 <_bar>: - 8000007: fc cc 14 00 mov 134217748,d0 - 800000b: 00 08 - 800000d: fc cd 15 80 mov 134250517,d1 - 8000011: 00 08 - 8000013: cb nop +0800007b <_bar>: + 800007b: fc cc 88 00 mov 134217864,d0 + 800007f: 00 08 + 8000081: fc cd 89 80 mov 134250633,d1 + 8000085: 00 08 + 8000087: cb nop diff --git a/ld/testsuite/ld-mn10300/mn10300.exp b/ld/testsuite/ld-mn10300/mn10300.exp index 14ba85b..18bbad3 100644 --- a/ld/testsuite/ld-mn10300/mn10300.exp +++ b/ld/testsuite/ld-mn10300/mn10300.exp @@ -22,17 +22,17 @@ if {!([istarget "am3*-*-*"]) && !([istarget "mn10300*-*-*"]) } { # Set up a list as described in ld-lib.exp -set am33_tests { +set mn10300_tests { { "am33 string merging" - "--relax -Ttext 0x8000000" + "-relax -Ttext 0x8000074" "" { "i36434.s" "i36434-2.s" } { {objdump -dz i36434.d} } "i36434.x" } { - "difference of two symbols" + "difference of two same-section symbols" "-Ttext 0" "" { "i112045-1.s" } @@ -40,20 +40,45 @@ set am33_tests { "i112045-1.x" } { - "(shared) difference of two symbols" - "-shared" + "difference of two same-section symbols where the difference is held in another section" + "-relax -Ttext 100" "" - { "i112045-2.s" } - { {objdump -R i112045-2.d} } - "i112045-2.x" + { "i112045-3.s" } + { {objdump -D i112045-3.d} } + "i112045-3.x" } { "adjustment of symbols due to relaxation" - "-Tdata 1f -relax" + "-Tdata 1f -Ttext 0 -relax" + "" + { "i135409-1.s" } + { {readelf --syms i135409-1.d} } + "i135409-1.x" + } + { + "adjustment of symbols due to relaxation (with alignment directives)" + "-Tdata 1f -Ttext 0 -relax" + "" + { "i135409-2.s" } + { {readelf --syms i135409-2.d} } + "i135409-2.x" + } +} + +run_ld_link_tests $mn10300_tests + +if {!([istarget "am3*-*-*"])} { + return +} + +set am33_tests { + { + "difference of two same-section symbols (in a shared library)" + "-shared" "" - { "i135409.s" } - { {readelf --syms i135409.d } } - "i135409.x" + { "i112045-2.s" } + { {objdump -R i112045-2.d} } + "i112045-2.x" } } @@ -66,7 +91,11 @@ proc i126256-test { } { global subdir set tmpdir tmpdir - set testname "Issue 126256 - seg fault whilst linking one shared library into another when relaxation is enabled." + set testname "Seg fault whilst linking one shared library into another when relaxation is enabled." + + if {![is_remote host] && [which $CC] == 0} then { + return + } if { ![ld_compile "$CC -mrelax -fPIC" $srcdir/$subdir/i126256-1.c $tmpdir/i126256-1.o] } { unresolved $testname |