diff options
author | Stephen Casner <casner@acm.org> | 2020-04-21 15:10:52 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-04-21 15:10:52 +0100 |
commit | 39a7b38fac0e6e90baa3d661a271377db3ba1765 (patch) | |
tree | 7773ee3c91298bde03a43c7558b6a2513b9fc28c /ld/testsuite | |
parent | d89edf9b811ac3c5643b8a866c238a93f35a5e6c (diff) | |
download | gdb-39a7b38fac0e6e90baa3d661a271377db3ba1765.zip gdb-39a7b38fac0e6e90baa3d661a271377db3ba1765.tar.gz gdb-39a7b38fac0e6e90baa3d661a271377db3ba1765.tar.bz2 |
Fix linker tests to work with 16-bit targets.
PR 25829
* testsuite/ld-scripts/script.exp (check_script)
(extract_symbol_test): Make test addresses fit in 16 bits.
* testsuite/ld-scripts/memory.t: Likewise.
* testsuite/ld-scripts/memory_sym.t (TXT_LENGTH): Likewise.
* testsuite/ld-scripts/default-script.t (_START): Likewise.
* testsuite/ld-scripts/default-script1.d: Likewise.
* testsuite/ld-scripts/default-script2.d: Likewise.
* testsuite/ld-scripts/default-script3.d: Likewise.
* testsuite/ld-scripts/default-script4.d: Likewise.
* testsuite/ld-scripts/empty-address-1.t: Likewise.
* testsuite/ld-scripts/empty-address-1.d: Likewise.
* testsuite/ld-scripts/empty-address-2a.d: Likewise.
* testsuite/ld-scripts/empty-address-2b.d: Likewise.
* testsuite/ld-misc/start.s: .long -> .dc.a to allow relocation to
fit target address size.
* testsuite/ld-scripts/empty-address-1.s: Likewise.
* testsuite/ld-scripts/empty-address-2.s: Likewise.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ld-misc/start.s | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/default-script.t | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/default-script1.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/default-script2.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/default-script3.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/default-script4.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-1.d | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-1.s | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-1.t | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2.s | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2a.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2b.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/memory.t | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/memory_sym.t | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/script.exp | 6 |
15 files changed, 39 insertions, 31 deletions
diff --git a/ld/testsuite/ld-misc/start.s b/ld/testsuite/ld-misc/start.s index 846236e..b01c559 100644 --- a/ld/testsuite/ld-misc/start.s +++ b/ld/testsuite/ld-misc/start.s @@ -7,4 +7,4 @@ _start: __start: .global main /* Used by HPPA targets. */ main: - .long foo + .dc.a foo diff --git a/ld/testsuite/ld-scripts/default-script.t b/ld/testsuite/ld-scripts/default-script.t index fc70187..ff0fcda 100644 --- a/ld/testsuite/ld-scripts/default-script.t +++ b/ld/testsuite/ld-scripts/default-script.t @@ -1,4 +1,4 @@ -_START = DEFINED(_START) ? _START : 0x9000000; +_START = DEFINED(_START) ? _START : 0x900; SECTIONS { . = _START; diff --git a/ld/testsuite/ld-scripts/default-script1.d b/ld/testsuite/ld-scripts/default-script1.d index 61973f7..a749265 100644 --- a/ld/testsuite/ld-scripts/default-script1.d +++ b/ld/testsuite/ld-scripts/default-script1.d @@ -1,9 +1,11 @@ # source: default-script.s -# ld: -defsym _START=0x8000000 -T default-script.t +# ld: -defsym _START=0x800 -T default-script.t # nm: -n +# skip: *-*-mingw64 x86_64-*-cygwin +# Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000 #... -0*8000000 . _START +0*800 . _START #... -0*8000000 T text +0*800 T text #pass diff --git a/ld/testsuite/ld-scripts/default-script2.d b/ld/testsuite/ld-scripts/default-script2.d index 68ce2aa..137cf09 100644 --- a/ld/testsuite/ld-scripts/default-script2.d +++ b/ld/testsuite/ld-scripts/default-script2.d @@ -1,9 +1,11 @@ # source: default-script.s -# ld: -T default-script.t -defsym _START=0x8000000 +# ld: -T default-script.t -defsym _START=0x800 # nm: -n +# skip: *-*-mingw64 x86_64-*-cygwin +# Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000 #... -0*8000000 . _START +0*800 . _START #... -0*9000000 T text +0*900 T text #pass diff --git a/ld/testsuite/ld-scripts/default-script3.d b/ld/testsuite/ld-scripts/default-script3.d index b2da496..00f64ec 100644 --- a/ld/testsuite/ld-scripts/default-script3.d +++ b/ld/testsuite/ld-scripts/default-script3.d @@ -1,9 +1,11 @@ # source: default-script.s -# ld: -defsym _START=0x8000000 -dT default-script.t +# ld: -defsym _START=0x800 -dT default-script.t # nm: -n +# skip: *-*-mingw64 x86_64-*-cygwin +# Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000 #... -0*8000000 . _START +0*800 . _START #... -0*8000000 T text +0*800 T text #pass diff --git a/ld/testsuite/ld-scripts/default-script4.d b/ld/testsuite/ld-scripts/default-script4.d index 0010084..dc4f33b 100644 --- a/ld/testsuite/ld-scripts/default-script4.d +++ b/ld/testsuite/ld-scripts/default-script4.d @@ -1,9 +1,11 @@ # source: default-script.s -# ld: --default-script default-script.t -defsym _START=0x8000000 +# ld: --default-script default-script.t -defsym _START=0x800 # nm: -n +# skip: *-*-mingw64 x86_64-*-cygwin +# Skipped on Mingw64 and Cygwin because the image base defaults to 0x100000000 #... -0*8000000 . _START +0*800 . _START #... -0*8000000 T text +0*800 T text #pass diff --git a/ld/testsuite/ld-scripts/empty-address-1.d b/ld/testsuite/ld-scripts/empty-address-1.d index 5b18217..c758b96 100644 --- a/ld/testsuite/ld-scripts/empty-address-1.d +++ b/ld/testsuite/ld-scripts/empty-address-1.d @@ -2,8 +2,8 @@ #nm: -n #xfail: frv-*-*linux* #... -0+0 T _start +0+0 [AT] _start #... -0+2000000 [ADT] __data_end -0+2000000 [ADT] __data_start +0+200 [ADT] __data_end +0+200 [ADT] __data_start #pass diff --git a/ld/testsuite/ld-scripts/empty-address-1.s b/ld/testsuite/ld-scripts/empty-address-1.s index c5cc1a5..7ffe2d5 100644 --- a/ld/testsuite/ld-scripts/empty-address-1.s +++ b/ld/testsuite/ld-scripts/empty-address-1.s @@ -1,5 +1,5 @@ .text .global _start _start: - .long __data_start - .long __data_end + .dc.a __data_start + .dc.a __data_end diff --git a/ld/testsuite/ld-scripts/empty-address-1.t b/ld/testsuite/ld-scripts/empty-address-1.t index 57a8bed..7c4b815 100644 --- a/ld/testsuite/ld-scripts/empty-address-1.t +++ b/ld/testsuite/ld-scripts/empty-address-1.t @@ -1,7 +1,7 @@ SECTIONS { .text 0x0000000: { *(.text) } - .data 0x2000000: + .data 0x200: { __data_start = . ; *(.data) diff --git a/ld/testsuite/ld-scripts/empty-address-2.s b/ld/testsuite/ld-scripts/empty-address-2.s index 79f58ea..14d35d8 100644 --- a/ld/testsuite/ld-scripts/empty-address-2.s +++ b/ld/testsuite/ld-scripts/empty-address-2.s @@ -1,5 +1,5 @@ .text .global _start _start: - .long __data_end + .dc.a __data_end .p2align 4 diff --git a/ld/testsuite/ld-scripts/empty-address-2a.d b/ld/testsuite/ld-scripts/empty-address-2a.d index d27bf00..85aa648 100644 --- a/ld/testsuite/ld-scripts/empty-address-2a.d +++ b/ld/testsuite/ld-scripts/empty-address-2a.d @@ -1,7 +1,7 @@ #source: empty-address-2.s -#ld: -Ttext 0x0000000 -Tdata 0x2000000 -T empty-address-2a.t +#ld: -Ttext 0x0000000 -Tdata 0x200 -T empty-address-2a.t #nm: -n -#xfail: frv-*-*linux* +#xfail: frv-*-*linux* riscv64-*-* #... 0+0 T _start #... diff --git a/ld/testsuite/ld-scripts/empty-address-2b.d b/ld/testsuite/ld-scripts/empty-address-2b.d index eb23e74..9e6bc3d 100644 --- a/ld/testsuite/ld-scripts/empty-address-2b.d +++ b/ld/testsuite/ld-scripts/empty-address-2b.d @@ -1,7 +1,7 @@ #source: empty-address-2.s -#ld: -Ttext 0x0000000 -Tdata 0x2000000 -T empty-address-2b.t +#ld: -Ttext 0x0000000 -Tdata 0x200 -T empty-address-2b.t #nm: -n -#xfail: frv-*-*linux* +#xfail: frv-*-*linux* riscv64-*-* #... 0+0 T _start #... diff --git a/ld/testsuite/ld-scripts/memory.t b/ld/testsuite/ld-scripts/memory.t index 937394f..5b2feb1 100644 --- a/ld/testsuite/ld-scripts/memory.t +++ b/ld/testsuite/ld-scripts/memory.t @@ -1,7 +1,7 @@ MEMORY { - R_TEXTMEM (ARX) : ORIGIN = 0x100, LENGTH = 32K - R_DATAMEM (AW) : org = 0x1000, l = (64 * 1024) + R_TEXTMEM (ARX) : ORIGIN = 0x100, LENGTH = 16K + R_DATAMEM (AW) : org = 0x1000, l = (4 * 1024) } REGION_ALIAS ("A_TEXTMEM", R_TEXTMEM); diff --git a/ld/testsuite/ld-scripts/memory_sym.t b/ld/testsuite/ld-scripts/memory_sym.t index 4ccec55..c9df2ed 100644 --- a/ld/testsuite/ld-scripts/memory_sym.t +++ b/ld/testsuite/ld-scripts/memory_sym.t @@ -1,5 +1,5 @@ TXT_ORIGIN = 0x100; -TXT_LENGTH = 32K; +TXT_LENGTH = 16K; MEMORY { R_TEXTMEM (ARX) : ORIGIN = TXT_ORIGIN, LENGTH = TXT_LENGTH diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp index 5a01279..eaa4f53 100644 --- a/ld/testsuite/ld-scripts/script.exp +++ b/ld/testsuite/ld-scripts/script.exp @@ -67,7 +67,7 @@ proc check_script { } { } if {[info exists nm_output(tred)] \ - && $nm_output(tred) != (0x100 + 0x8000)} { + && $nm_output(tred) != (0x100 + 0x4000)} { send_log "tred == $nm_output(tred)\n" verbose "tred == $nm_output(tred)" set passes 0 @@ -87,7 +87,7 @@ proc check_script { } { } if {[info exists nm_output(fred)] \ - && $nm_output(fred) != (0x1000 + 0x10000)} { + && $nm_output(fred) != (0x1000 + 0x1000)} { send_log "fred == $nm_output(fred)\n" verbose "fred == $nm_output(fred)" set passes 0 @@ -215,7 +215,7 @@ if ![ld_link $ld tmpdir/script "$flags -T $srcdir/$subdir/memory.t tmpdir/script } set testname "MEMORY with symbols" -if ![ld_link $ld tmpdir/script "$flags -defsym DATA_ORIGIN=0x1000 -defsym DATA_LENGTH=0x10000 -T $srcdir/$subdir/memory_sym.t tmpdir/script.o"] { +if ![ld_link $ld tmpdir/script "$flags -defsym DATA_ORIGIN=0x1000 -defsym DATA_LENGTH=0x1000 -T $srcdir/$subdir/memory_sym.t tmpdir/script.o"] { fail $testname untested "extract symbols" } else { |