+2020-04-21 Stephen Casner <casner@acm.org>
+
+ 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.
+
2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/25849
__start:
.global main /* Used by HPPA targets. */
main:
- .long foo
+ .dc.a foo
-_START = DEFINED(_START) ? _START : 0x9000000;
+_START = DEFINED(_START) ? _START : 0x900;
SECTIONS
{
. = _START;
# 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
# 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
# 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
# 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
#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
.text
.global _start
_start:
- .long __data_start
- .long __data_end
+ .dc.a __data_start
+ .dc.a __data_end
SECTIONS
{
.text 0x0000000: { *(.text) }
- .data 0x2000000:
+ .data 0x200:
{
__data_start = . ;
*(.data)
.text
.global _start
_start:
- .long __data_end
+ .dc.a __data_end
.p2align 4
#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
#...
#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
#...
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);
TXT_ORIGIN = 0x100;
-TXT_LENGTH = 32K;
+TXT_LENGTH = 16K;
MEMORY
{
R_TEXTMEM (ARX) : ORIGIN = TXT_ORIGIN, LENGTH = TXT_LENGTH
}
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
}
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
}
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 {