OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/gnu-src/binutils-2.18.50/ld/testsuite/ld-scripts
    from Rev 38 to Rev 156
    Reverse comparison

Rev 38 → Rev 156

/alignof.s
0,0 → 1,9
 
.text
.p2align 6
.long 0
 
.data
.p2align 4
.long 0
/empty-address-1.s
0,0 → 1,5
.text
.global _start
_start:
.long __data_start
.long __data_end
/alignof.t
0,0 → 1,15
SECTIONS {
.text :
{
tmpdir/alignof.o (.text)
}
.data :
{
tmpdir/alignof.o (.data)
LONG (ALIGNOF(.text))
LONG (ALIGNOF(.data))
}
}
 
alignof_text = ALIGNOF(.text);
alignof_data = ALIGNOF(.data);
/empty-address-1.t
0,0 → 1,11
SECTIONS
{
.text 0x0000000: { *(.text) }
.data 0x2000000:
{
__data_start = . ;
*(.data)
}
__data_end = .;
/DISCARD/ : { *(.*) }
}
/expr1.d
0,0 → 1,2
# ld: -T expr1.t
# error: undefined section .* in expression
/phdrs.s
0,0 → 1,8
.text
 
.long 1
 
.data
 
.long 2
/phdrs.t
0,0 → 1,16
PHDRS
{
header PT_PHDR PHDRS ;
text PT_LOAD FILEHDR PHDRS ;
data PT_LOAD ;
}
 
SECTIONS
{
/* This test will fail on architectures where the startaddress below
is less than the constant MAXPAGESIZE. */
. = 0x800000 + SIZEOF_HEADERS;
.text : { *(.text) } :text
.data : { *(.data) } :data
/DISCARD/ : { *(.*) }
}
/rgn-over1.t
0,0 → 1,13
/* Memory region overflow tests: one region, first output sect doesn't fit. */
 
MEMORY {
bss (rwx) : ORIGIN = 0, LENGTH = 0
r1 (rwx) : ORIGIN = 0x1000, LENGTH = 8
}
_start = 0x1000;
SECTIONS {
.bss : { *(.bss) } > bss
.text : { *(.txt) } > r1
.data : { *(.dat) } > r1
/DISCARD/ : { *(*) }
}
/empty-address-2a.t
0,0 → 1,7
SECTIONS
{
.text : { *(.text) }
.data : { *(.data) }
__data_end = .;
/DISCARD/ : { *(.*) }
}
/sort_n_a-a.s
0,0 → 1,16
.section .text2
.p2align 3
text2a:
.long 0
.section .text3
.p2align 5
text3a:
.long 0
.section .text1
.p2align 5
text1a:
.long 0
.text
texta:
.p2align 4
.long 0
/sort_no.t
0,0 → 1,5
SECTIONS
{
.text : {*(.text*)}
/DISCARD/ : { *(.*) }
}
/rgn-over5.t
0,0 → 1,14
/* Memory region overflow tests: overflow LMA but not VMA. */
 
MEMORY {
bss (rwx) : ORIGIN = 0, LENGTH = 0
r1 (rwx) : ORIGIN = 0x1000, LENGTH = 24
v1 (rwx) : ORIGIN = 0x2000, LENGTH = 8
}
_start = 0x1000;
SECTIONS {
.bss : { *(.bss) } > bss
.text : { *(.txt) } > r1 AT> v1
.data : { *(.dat) } > r1 AT> v1
/DISCARD/ : { *(*) }
}
/provide-1.d
0,0 → 1,9
#source: provide-1.s
#ld: -T provide-1.t
#objdump: -s -j .data
 
.*: file format .*
 
Contents of section .data:
[0-9a-f]* (1020)?0000(2010)? (2020)?0000(2020)? 00000000 .*
#pass
/sort_b_a.s
0,0 → 1,16
.section .text2
.p2align 3
text2:
.long 0
.section .text3
.p2align 6
text3:
.long 0
.section .text1
.p2align 5
text1:
.long 0
.text
text:
.p2align 4
.long 0
/weak.t
0,0 → 1,12
SECTIONS
{
.text 0x1000 : {
tmpdir/weak1.o(.data)
}
.data 0x2000 : {
tmpdir/weak2.o(.data)
}
/DISCARD/ : {
*(*)
}
}
/default-script2.d
0,0 → 1,9
# source: default-script.s
# ld: -T default-script.t -defsym _START=0x8000000
# nm: -n
 
#...
0*8000000 . _START
#...
0*9000000 t text
#pass
/sort_b_a.t
0,0 → 1,5
SECTIONS
{
.text : {*(SORT_BY_ALIGNMENT(.text*))}
/DISCARD/ : { *(.*) }
}
/cross1.c
0,0 → 1,6
extern int foo ();
int
func ()
{
return foo ();
}
/expr1.s
0,0 → 1,2
.word 0
 
/align2c.d
0,0 → 1,2
# ld: -T align2.t
# error: undefined symbol.*in expression
/expr1.t
0,0 → 1,12
ENTRY(RAM)
 
MEMORY
{
ram (rwx) : ORIGIN = 0, LENGTH = 0x1000000
}
 
SECTIONS
{
.text : { } >ram
}
RAM = ADDR(ram);
/defined2.d
0,0 → 1,22
#ld: -Tdefined2.t
#nm: -B
#source: phdrs.s
#xfail: "rs6000-*-aix*"
 
# Check that arithmetic on DEFINED works.
# Matching both A and T accounts for formats that can't tell a .text
# symbol from an absolute symbol (mmo), but matches whatever section that
# contains an address matching the value. The symbol sym1 is supposed to
# be in the .text section for all targets, though.
 
#...
0+1 [AT] defined1
#...
0+11 A defined2
#...
0+100 A defined3
#...
0+1ff A defined4
#...
0+3 T sym1
#pass
/provide-1.s
0,0 → 1,4
.data
.globl foo
foo: .long 0
.p2align 4
/provide-1.t
0,0 → 1,12
SECTIONS
{
.data 0x2000 :
{
LONG (foo)
LONG (bar)
. = ALIGN (0x10);
*(.data)
}
PROVIDE (foo = .);
PROVIDE (bar = .);
}
/expr.exp
0,0 → 1,23
# Test ALIGN in a linker script.
# By Nathan Sidwell, CodeSourcery LLC
# Copyright 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
run_dump_test expr1
/sort_b_a_a-3.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_a_a.t --sort-section name
#name: SORT_BY_ALIGNMENT(SORT_BY_ALIGNMENT()) --sort-section name
#nm: -n
 
0[0-9a-f]* t text3b
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text3a
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
/empty-address.exp
0,0 → 1,28
# Make sure that "dot" is updated for empty sections if their addresses
# are set.
# Copyright 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
run_dump_test empty-address-1
run_dump_test empty-address-2a
run_dump_test empty-address-2b
run_dump_test empty-address-3a
run_dump_test empty-address-3b
run_dump_test empty-address-3c
/cross1.t
0,0 → 1,10
NOCROSSREFS ( .text .data )
SECTIONS
{
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.hash : { *(.hash) }
.toc : { *(.toc) }
.text : { tmpdir/cross1.o }
.data : { tmpdir/cross2.o }
}
/empty-orphan.exp
0,0 → 1,34
# Make sure orphan sections do not lead to huge output files.
# By David Heine, Tensilica, Inc.
# Copyright 2005, 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# PHDRS is only meaningful for ELF.
if ![is_elf_format] {
return
}
 
if { [istarget spu*-*-*] } {
set LDFLAGS "--local-store 0:0"
}
 
set testname "empty-orphan"
 
run_dump_test empty-orphan
/align2c.s
0,0 → 1,4
.text
.long 0
.data
.long 0x12345678
/crossref.exp
0,0 → 1,134
# Test NOCROSSREFS in a linker script.
# By Ian Lance Taylor, Cygnus Support.
# Copyright 2000, 2001, 2002, 2003, 2004, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set test1 "NOCROSSREFS 1"
set test2 "NOCROSSREFS 2"
set test3 "NOCROSSREFS 3"
 
if { ![is_remote host] && [which $CC] == 0 } {
untested $test1
untested $test2
untested $test3
return
}
 
# Xtensa targets currently default to putting literal values in a separate
# section and that requires linker script support, so put literals in text.
global CFLAGS
if [istarget xtensa*-*-*] {
set CFLAGS "$CFLAGS -mtext-section-literals"
}
 
# If we have a compiler that doesn't use/reference dot-symbols, then
# calls to functions reference the .opd section function descriptor.
# This makes NOCROSSREFS rather useless on powerpc64.
if [istarget powerpc64*-*-*] {
set CFLAGS "$CFLAGS -mcall-aixdesc"
}
 
# Prevent the use of the MeP's small data area which references a symbol
# called __sdabase which will not be defined by our test linker scripts.
if [istarget mep*-*-elf] {
set CFLAGS "-mtiny=0"
}
 
if { ![ld_compile $CC "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \
|| ![ld_compile $CC "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } {
unresolved $test1
unresolved $test2
return
}
 
set flags [big_or_little_endian]
 
if [istarget sh64*-*-elf] {
# This is what gcc passes to ld by default.
set flags "-mshelf32"
}
 
# IA64 has both ordered and unordered sections in an input file.
setup_xfail ia64-*-*
 
set exec_output [run_host_cmd "$ld" "$flags -o tmpdir/cross1 -T $srcdir/$subdir/cross1.t tmpdir/cross1.o tmpdir/cross2.o"]
 
set exec_output [prune_warnings $exec_output]
 
regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
 
if [string match "" $exec_output] then {
fail $test1
} else {
verbose -log "$exec_output"
if [regexp "prohibited cross reference from .* to `.*foo' in" $exec_output] {
pass $test1
} else {
fail $test1
}
}
 
# Check cross references within a single object.
 
if { ![ld_compile $CC "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } {
unresolved $test2
return
}
 
set exec_output [run_host_cmd "$ld" "$flags -o tmpdir/cross2 -T $srcdir/$subdir/cross2.t tmpdir/cross3.o"]
set exec_output [prune_warnings $exec_output]
 
regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
 
if [string match "" $exec_output] then {
fail $test2
} else {
verbose -log "$exec_output"
if [regexp "prohibited cross reference from .* to `.*' in" $exec_output] {
pass $test2
} else {
fail $test2
}
}
 
# Check cross references for ld -r
 
if { ![ld_compile $CC "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } {
unresolved $test3
return
}
 
if ![ld_relocate $ld tmpdir/cross3-partial.o "tmpdir/cross1.o tmpdir/cross4.o"] {
unresolved $test3
return
}
 
set exec_output [run_host_cmd "$ld" "$flags -o tmpdir/cross3 -T $srcdir/$subdir/cross3.t tmpdir/cross3-partial.o tmpdir/cross2.o"]
 
set exec_output [prune_warnings $exec_output]
 
regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
 
if [string match "" $exec_output] then {
pass $test3
} else {
verbose -log "$exec_output"
fail $test3
}
/defined2.t
0,0 → 1,9
SECTIONS {
.text : { *(.text) sym1 = 3 - DEFINED (x); }
.data : { *(.data) }
.bss : { *(.bss) *(COMMON) }
}
defined1 = !DEFINED (x);
defined2 = DEFINED (defined1) + 16;
defined3 = DEFINED (defined2) * 256;
defined4 = 0x200 - DEFINED (defined3);
/sort_b_a_n-1.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_a_n.t
#name: SORT_BY_ALIGNMENT(SORT_BY_NAME())
#nm: -n
 
0[0-9a-f]* t text3b
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text3a
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
/rgn-over.exp
0,0 → 1,54
# Test for proper diagnosis of overflowed memory regions.
# Copyright 2007 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
if ![is_elf_format] {
return
}
 
load_lib ld-lib.exp
 
set old_ldflags $LDFLAGS
if { [istarget spu*-*-*] } {
set LDFLAGS "$LDFLAGS --no-overlays"
}
 
set test_list [lsort [glob -nocomplain $srcdir/$subdir/rgn-over*.d]]
foreach test_file $test_list {
set test_name [file rootname $test_file]
set map_file "tmpdir/[file tail $test_name].map"
verbose $test_name
run_dump_test $test_name
 
if { ! [regexp ".*-ok.d" $test_file] } {
set testname "[file tail $test_name] (map check)"
if [file exists $map_file] {
# compare the map file to the expectations in the .d file
# (run_dump_test can't do that).
if [regexp_diff $map_file $test_file] {
fail $testname
} else {
pass $testname
}
} else {
untested $testname
}
}
}
set LDFLAGS $old_ldflags
/map-address.exp
0,0 → 1,47
# Test address printed by --print-map
# Copyright 2002, 2007 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set testname "map addresses"
 
# The source file doesn't matter. Pinch one from the sizeof test.
if {![ld_assemble $as $srcdir/$subdir/sizeof.s tmpdir/map-address.o]} {
unresolved $testname
return
}
 
if {![ld_simple_link $ld tmpdir/map-address \
"-T $srcdir/$subdir/map-address.t \
tmpdir/map-address.o \
-Map tmpdir/map-address.map"]} {
fail $testname
return
}
 
if [is_remote host] then {
remote_upload host "tmpdir/map_address.map"
}
 
if {[regexp_diff \
"tmpdir/map-address.map" \
"$srcdir/$subdir/map-address.d"]} {
fail $testname
} else {
pass $testname
}
/phdrs2.exp
0,0 → 1,74
# Test PHDRS with empty sections in a linker script.
# Copyright 2007 Free Software Foundation, Inc,
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# PHDRS2 is only meaningful for ELF.
if { ![istarget *-*-sysv4*] \
&& ![istarget *-*-unixware*] \
&& ![istarget *-*-elf*] \
&& ![istarget *-*-eabi*] \
&& ![istarget hppa*64*-*-hpux*] \
&& ![istarget *-*-linux*] \
&& ![istarget *-*-irix5*] \
&& ![istarget *-*-irix6*] \
&& ![istarget *-*-solaris2*] } {
return
}
 
if { [istarget *-*-linux*aout*] \
|| [istarget *-*-linux*oldld*] } {
return
}
 
# This is a very simplistic test.
 
set testname "PHDRS2"
 
set ldopt ""
if { [istarget spu*-*-*] } {
set ldopt "--local-store 0:0"
}
 
if ![ld_assemble $as $srcdir/$subdir/phdrs2.s tmpdir/phdrs2.o] {
unresolved $testname
return
}
 
set phdrs_regexp \
".*Program Header:.*LOAD *off *0x00\[0-9a-f\]* *vaddr *0x00*800000 *paddr *0x00*800000.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]*.*LOAD *off *0x00\[0-9a-f\]* *vaddr *0x00*800004 *paddr *0x00*800004.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags rw.*"
 
set ldopt "$ldopt -T $srcdir/$subdir/phdrs2.t tmpdir/phdrs2.o"
if ![ld_simple_link $ld tmpdir/phdrs2 $ldopt] {
fail $testname
} else {
if {![is_remote host] && [which $objdump] == 0} {
unresolved $testname
return
}
 
set exec_output [run_host_cmd "$objdump" "--private tmpdir/phdrs2"]
set exec_output [prune_warnings $exec_output]
verbose -log $exec_output
 
if [regexp $phdrs_regexp $exec_output] {
pass $testname
} else {
fail $testname
}
}
/sizeof.s
0,0 → 1,74
.space 16
/sizeof.t
0,0 → 1,17
SECTIONS {
.text :
{
text_start = .;
tmpdir/sizeof.o
text_end = .;
}
.data :
{
data_start = .;
. = . + SIZEOF(.text);
data_end = .;
}
}
 
sizeof_text = SIZEOF(.text);
sizeof_data = SIZEOF(.data);
/assert.s
0,0 → 1,17
 
/provide.exp
0,0 → 1,45
# Test PROVIDE in a linker script.
# By Nathan Sidwell, CodeSourcery LLC
# Copyright 2004, 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# AIX maps .text and .data to other sections.
# a.out objdump displays the file header inside the text segment,
# confusing run_dump_test.
 
if {[istarget "rs6000-*-aix*"] || [is_aout_format]} {
unsupported provide-1
unsupported provide-2
unsupported provide-3
return
}
 
global LDFLAGS
set saved_LDFLAGS "$LDFLAGS"
if [istarget "x86_64-*-mingw*"] then {
set LDFLAGS "$LDFLAGS --image-base 0"
}
 
run_dump_test provide-1
run_dump_test provide-2
setup_xfail *-*-*
run_dump_test provide-3
 
set LDFLAGS "$saved_LDFLAGS"
/sort_b_n_n-2.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_n_n.t --sort-section name
#name: SORT_BY_NAME(SORT_BY_NAME()) --sort-section name
#nm: -n
 
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
0[0-9a-f]* t text3a
0[0-9a-f]* t text3b
/assert.t
0,0 → 1,10
SECTIONS
{
.empty : {
here = . == ADDR(.empty);
ASSERT (. == ADDR(.empty), "dot is not ADDR");
ASSERT (here, "here is zero");
}
ASSERT (!SIZEOF(.empty), "Empty is not empty")
/DISCARD/ : { *(.reginfo) }
}
/rgn-over2.d
0,0 → 1,35
# name: rgn-over2
# source: rgn-over.s
# ld: -T rgn-over2.t -Map tmpdir/rgn-over2.map
# error: \A[^ \n]*?ld[^:\n]*?: [^\n]*?section \.data will not fit in region r1\n[^ \n]*?ld[^:\n]*?: region r1 overflowed by 4 bytes\Z
 
Discarded input sections
#...
Memory\s+Configuration
 
Name\s+Origin\s+Length\s+Attributes
bss\s+0x0+0000\s+0x0+0000\s+xrw
r1\s+0x0+1000\s+0x0+0014\s+xrw
\*default\*\s+0x0+0000\s+0xf+ffff
 
Linker\s+script\s+and\s+memory\s+map
 
\s*0x0+1000\s+_start\s+=\s+0x1000
 
\s*\.bss\s+0x0+0000\s+0x0
\s*\*\(\.bss\)
\s*\.bss\s+0x0+0000\s+0x0\s+.*?
 
\s*\.text\s+0x0+1000\s+0xc
\s*\*\(\.txt\)
\s*\.txt\s+0x0+1000\s+0xc\s+.*?
 
\s*\.data\s+0x0+100c\s+0xc
\s*\*\(\.dat\)
\s*\.dat\s+0x0+100c\s+0xc\s+.*?
 
/DISCARD/
\*\(\*\)
LOAD\s+.*?
OUTPUT\(.*?\)
#pass
/empty-address-2b.d
0,0 → 1,8
#source: empty-address-2.s
#ld: -Ttext 0x0000000 -Tdata 0x2000000 -T empty-address-2b.t
#nm: -n
#...
0+0 T _start
#...
0+10 A __data_end
#pass
/sort_b_a_n.t
0,0 → 1,5
SECTIONS
{
.text : {*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*)))}
/DISCARD/ : { *(.*) }
}
/rgn-over6.d
0,0 → 1,36
# name: rgn-over6
# source: rgn-over.s
# ld: -T rgn-over6.t -Map tmpdir/rgn-over6.map
# error: \A[^ \n]*?ld[^:\n]*?: [^\n]*?section \.text will not fit in region r1\n[^ \n]*?ld[^:\n]*?: [^\n]*?section \.text will not fit in region v1\n[^ \n]*?ld[^:\n]*?: region r1 overflowed by 16 bytes\n[^ \n]*?ld[^:\n]*?: region v1 overflowed by 16 bytes\Z
 
Discarded input sections
#...
Memory\s+Configuration
 
Name\s+Origin\s+Length\s+Attributes
bss\s+0x0+0000\s+0x0+0000\s+xrw
r1\s+0x0+1000\s+0x0+0008\s+xrw
v1\s+0x0+2000\s+0x0+0008\s+xrw
\*default\*\s+0x0+0000\s+0xf+ffff
 
Linker\s+script\s+and\s+memory\s+map
 
\s*0x0+1000\s+_start\s+=\s+0x1000
 
\s*\.bss\s+0x0+0000\s+0x0
\s*\*\(\.bss\)
\s*\.bss\s+0x0+0000\s+0x0\s+.*?
 
\s*\.text\s+0x0+1000\s+0xc\s+load\s+address\s+0x0+2000
\s*\*\(\.txt\)
\s*\.txt\s+0x0+1000\s+0xc\s+.*?
 
\s*\.data\s+0x0+100c\s+0xc\s+load\s+address\s+0x0+200c
\s*\*\(\.dat\)
\s*\.dat\s+0x0+100c\s+0xc\s+.*?
 
/DISCARD/
\*\(\*\)
LOAD\s+.*?
OUTPUT\(.*?\)
#pass
/empty-aligned.d
0,0 → 1,13
#source: empty-aligned.s
#ld: -T empty-aligned.t
#readelf: -l --wide
#xfail: "hppa64-*-*"
 
#...
Program Headers:
+Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align
+LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ [RWE ]+ +0x[0-9a-f]+
 
Section to Segment mapping:
+Segment Sections\.\.\.
+00 +.text
/empty-address-2.s
0,0 → 1,5
.text
.global _start
_start:
.long __data_end
.p2align 4
/map-address.d
0,0 → 1,12
#...
Linker script and memory map
#...
*0x0*000020 *def1 = .*
*0x0*000020 *def2 = def1
*0x0*010001 *\. = 0x10001
*0x0*010001 *foo = \.
*0x0*010201 *\. = \(\. \+ 0x200\)
*0x0*010201 *bar = \.
*0x0*010204 *\. = ALIGN \(0x4\)
*0x0*010204 *frob = \.
#pass
/rgn-over2.t
0,0 → 1,14
/* Memory region overflow tests: one region, first output sect fits,
second doesn't. */
 
MEMORY {
bss (rwx) : ORIGIN = 0, LENGTH = 0
r1 (rwx) : ORIGIN = 0x1000, LENGTH = 20
}
_start = 0x1000;
SECTIONS {
.bss : { *(.bss) } > bss
.text : { *(.txt) } > r1
.data : { *(.dat) } > r1
/DISCARD/ : { *(*) }
}
/empty-address-2b.t
0,0 → 1,11
SECTIONS
{
.text 0x0000000: { *(.text) }
.data :
{
PROVIDE (__data_start = .);
*(.data)
}
__data_end = .;
/DISCARD/ : { *(.*) }
}
/sort_n_a-b.s
0,0 → 1,16
.section .text2
.p2align 3
text2b:
.long 0
.section .text3
.p2align 6
text3b:
.long 0
.section .text1
.p2align 5
text1b:
.long 0
.text
textb:
.p2align 4
.long 0
/sort_b_n-1.d
0,0 → 1,9
#source: sort_b_n-1.s
#ld: -T sort.t --sort-section name
#name: --sort-section name
#nm: -n
 
0[0-9a-f]* t text
0[0-9a-f]* t text1
0[0-9a-f]* t text2
0[0-9a-f]* t text3
/rgn-over6.t
0,0 → 1,14
/* Memory region overflow tests: overflow LMA and VMA. */
 
MEMORY {
bss (rwx) : ORIGIN = 0, LENGTH = 0
r1 (rwx) : ORIGIN = 0x1000, LENGTH = 8
v1 (rwx) : ORIGIN = 0x2000, LENGTH = 8
}
_start = 0x1000;
SECTIONS {
.bss : { *(.bss) } > bss
.text : { *(.txt) } > r1 AT> v1
.data : { *(.dat) } > r1 AT> v1
/DISCARD/ : { *(*) }
}
/sort_b_n.d
0,0 → 1,9
#source: sort_b_n.s
#ld: -T sort_b_n.t
#name: SORT_BY_NAME
#nm: -n
 
0[0-9a-f]* t text
0[0-9a-f]* t text1
0[0-9a-f]* t text2
0[0-9a-f]* t text3
/provide-2.d
0,0 → 1,7
#source: provide-2.s
#ld: -T provide-2.t
#nm: -B
#...
0+3 A baz
0+2000 D foo
#pass
/sort.t
0,0 → 1,5
SECTIONS
{
.text : {*(.text .text.*)}
/DISCARD/ : { *(.*) }
}
/default-script3.d
0,0 → 1,9
# source: default-script.s
# ld: -defsym _START=0x8000000 -dT default-script.t
# nm: -n
 
#...
0*8000000 . _START
#...
0*8000000 t text
#pass
/align.s
0,0 → 1,2
.text
.long 0
/cross2.c
0,0 → 1,5
int
foo ()
{
return 1;
}
/assert.exp
0,0 → 1,34
# Test ASSERT in a linker script.
# By Nathan Sidwell, CodeSourcery LLC
# Copyright 2004, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set testname "ASSERT"
 
if ![ld_assemble $as $srcdir/$subdir/assert.s tmpdir/assert.o] {
unresolved $testname
return
}
 
if ![ld_simple_link $ld tmpdir/assert "-T $srcdir/$subdir/assert.t tmpdir/assert.o"] {
fail $testname
} else {
pass $testname
}
/align.t
0,0 → 1,8
SECTIONS
{
.text : {*(.text)}
.data ALIGN(0x40) : AT (ALIGN (LOADADDR (.text) + SIZEOF (.text), 0x80))
{}
ASSERT (LOADADDR(.data) == 0x80, "dyadic ALIGN broken")
ASSERT (ADDR(.data) == 0x40, "monadic ALIGN broken")
}
/empty-aligned.s
0,0 → 1,2
.text
.long 123
/empty-aligned.t
0,0 → 1,29
SECTIONS
{
.text : { *(.text) }
/* Alignment at beginning shouldn't result in empty section being kept. */
.text1 ALIGN (4096) :
{
*(.text1)
}
/* Same for alignment at beginning and end. */
.text2 ALIGN (4096) :
{
*(.text2)
. = ALIGN (4096);
}
/* Same for alignment just at end, although we need to be careful in
the expression used to align. */
.text3 :
{
*(.text3)
. = ALIGN (. != 0 ? 4096 : 1);
}
/* Same when setting vma and lma. This also shouldn't result in
.text3 being kept. */
.text4 ADDR (.text3) + SIZEOF (.text3) + 8192 : AT (LOADADDR (.text3))
{
*(.text4)
}
/DISCARD/ : { *(*) }
}
/map-address.t
0,0 → 1,11
SECTIONS
{
def1 = DEFINED(foo) ? 0x10 : 0x20;
def2 = def1;
. = 0x10001;
foo = .;
. += 0x200;
bar = .;
. = ALIGN (4);
frob = .;
}
/defined3.d
0,0 → 1,35
#ld: -Tdefined3.t
#nm: -B
#source: phdrs.s
#source: defined.s
#xfail: "rs6000-*-aix*"
 
# Check that DEFINED matches only symbols defined before its location.
# The ellipsis account for target-specific symbols. Matching both A and T
# accounts for formats that can't tell a .text symbol from an absolute
# symbol (mmo), but matches whatever section that contains an address
# matching the value.
 
#...
0+1 [AT] defined
#...
0+200 A defined1
#...
0+201 A defined2
#...
0+100 A defined3
#...
0+ [AT] defined4
#...
0+2a A defined5
#...
0+ [AT] defined6
#...
0+1 [AT] defined7
#...
0+1 [AT] defined8
#...
0+2a A sym1
#...
[0-9a-f]+ T sym2
#pass
/empty-address-3a.d
0,0 → 1,8
#source: empty-address-3.s
#ld: -T empty-address-3a.t
#nm: -n
#...
0+0 T _start
#...
0+10 A __data_end
#pass
/sort_b_n-1.s
0,0 → 1,12
.section .text.2
text2:
.long 0
.section .text.3
text3:
.long 0
.section .text.1
text1:
.long 0
.text
text:
.long 0
/sort_b_n.s
0,0 → 1,12
.section .text2
text2:
.long 0
.section .text3
text3:
.long 0
.section .text1
text1:
.long 0
.text
text:
.long 0
/sort_b_n.t
0,0 → 1,5
SECTIONS
{
.text : {*(SORT_BY_NAME(.text*))}
/DISCARD/ : { *(.*) }
}
/provide-2.s
0,0 → 1,8
.data
.globl foo
foo: .long 0
 
.globl baz
.long baz
 
.p2align 4
/provide-2.t
0,0 → 1,10
SECTIONS
{
PROVIDE (foo = 1);
PROVIDE (bar = 2);
PROVIDE (baz = 3);
.data 0x2000 :
{
*(.data)
}
}
/cross2.t
0,0 → 1,6
NOCROSSREFS ( .text .data )
SECTIONS
{
.text : { *(.text) *(.text.*) *(.pr) }
.data : { *(.data) *(.data.*) *(.sdata) *(.rw) *(.tc0) *(.tc) *(.toc) }
}
/align2.t
0,0 → 1,7
SECTIONS
{
.text : {*(.text)}
. = ALIGN(data_align);
.data : {*(.data)}
/DISCARD/ : {*(*)}
}
/defined3.t
0,0 → 1,15
defined6 = DEFINED (sym2) ? 1 : 0;
SECTIONS {
.text : { *(.text) sym2 = .; }
.data : { *(.data) }
.bss : { *(.bss) *(COMMON) }
}
defined4 = DEFINED (sym1) ? 1 : 0;
sym1 = 42;
defined3 = DEFINED (defined1) ? defined1 + 1 : 256;
defined1 = DEFINED (defined1) ? defined1 + 1 : 512;
defined2 = DEFINED (defined1) ? defined1 + 1 : 1024;
defined5 = DEFINED (sym1) ? sym1 : 0;
defined7 = DEFINED (sym2);
defined8 = !DEFINED (defined8);
defined = DEFINED (defined) ? defined : 42;
/empty-address-3a.t
0,0 → 1,10
SECTIONS
{
.text 0x00000000: { *(.text) }
.data ALIGN(0x1000) + (. & (0x1000 - 1)):
{
*(.data)
}
__data_end = .;
/DISCARD/ : { *(.*) }
}
/sort_b_n_a-1.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_n_a.t
#name: SORT_BY_NAME(SORT_BY_ALIGNMENT())
#nm: -n
 
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
0[0-9a-f]* t text3b
0[0-9a-f]* t text3a
/sort_b_a_n-2.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_a_n.t --sort-section name
#name: SORT_BY_ALIGNMENT(SORT_BY_NAME()) --sort-section name
#nm: -n
 
0[0-9a-f]* t text3b
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text3a
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
/dynamic-sections.d
0,0 → 1,6
# nm: -C
# ld: -T dynamic-sections.t
# name: dynamic sections
# source: dynamic-sections-1.s
# source: dynamic-sections-2.s
#pass
/script.exp
0,0 → 1,128
# Test basic linker script functionality
# By Ian Lance Taylor, Cygnus Support
# Copyright 1999, 2000, 2001, 2002, 2004, 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set testname "script"
 
if ![ld_assemble $as $srcdir/$subdir/script.s tmpdir/script.o] {
unresolved $testname
return
}
 
proc check_script { } {
global nm
global testname
global nm_output
 
if ![ld_nm $nm "" tmpdir/script] {
unresolved $testname
return
}
 
if {![info exists nm_output(text_start)] \
|| ![info exists nm_output(text_end)] \
|| ![info exists nm_output(data_start)] \
|| ![info exists nm_output(data_end)]} {
send_log "bad output from nm\n"
verbose "bad output from nm"
fail $testname
return
}
 
set passes 1
set text_end 0x104
set data_end 0x1004
 
if [istarget *c4x*-*-*] then {
set text_end 0x101
set data_end 0x1001
}
 
if [istarget *c54x*-*-*] then {
set text_end 0x102
set data_end 0x1002
}
 
if {$nm_output(text_start) != 0x100} {
send_log "text_start == $nm_output(text_start)\n"
verbose "text_start == $nm_output(text_start)"
set passes 0
}
 
if {$nm_output(text_end) < $text_end \
|| $nm_output(text_end) > 0x110} {
send_log "text_end == $nm_output(text_end)\n"
verbose "text_end == $nm_output(text_end)"
set passes 0
}
 
if {$nm_output(data_start) != 0x1000} {
send_log "data_start == $nm_output(data_start)\n"
verbose "data_start == $nm_output(data_start)"
set passes 0
}
 
if {$nm_output(data_end) < $data_end \
|| $nm_output(data_end) > 0x1010} {
send_log "data_end == $nm_output(data_end)\n"
verbose "data_end == $nm_output(data_end)"
set passes 0
}
 
if { $passes } {
pass $testname
} else {
fail $testname
}
}
 
# PE targets need to set the image base to 0 to avoid complications from nm.
set flags ""
if {[istarget "*-*-pe*"] \
|| [istarget "*-*-cygwin*"] \
|| [istarget "*-*-mingw*"] \
|| [istarget "*-*-winnt*"] \
|| [istarget "*-*-nt"] \
|| [istarget "*-*-interix*"] } then {
set flags "--image-base 0"
}
 
if ![ld_simple_link $ld tmpdir/script "$flags -T $srcdir/$subdir/script.t tmpdir/script.o"] {
fail $testname
} else {
check_script
}
 
set testname "MRI script"
 
if ![ld_simple_link $ld tmpdir/script "$flags -c $srcdir/$subdir/scriptm.t"] {
fail $testname
} else {
check_script
}
 
set testname "MEMORY"
 
if ![ld_simple_link $ld tmpdir/script "$flags -T $srcdir/$subdir/memory.t tmpdir/script.o"] {
fail $testname
} else {
check_script
}
/sort_no-1.d
0,0 → 1,9
#source: sort_b_n.s
#ld: -T sort_no.t
#name: no SORT_BY_NAME/SORT_BY_ALIGNMENT/SORT
#nm: -n
 
0[0-9a-f]* t text
0[0-9a-f]* t text2
0[0-9a-f]* t text3
0[0-9a-f]* t text1
/sort_b_n_n-3.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_n_n.t --sort-section alignment
#name: SORT_BY_NAME(SORT_BY_NAME()) --sort-section alignment
#nm: -n
 
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
0[0-9a-f]* t text3b
0[0-9a-f]* t text3a
/rgn-over3.d
0,0 → 1,36
# name: rgn-over3
# source: rgn-over.s
# ld: -T rgn-over3.t -Map tmpdir/rgn-over3.map
# error: \A[^ \n]*?ld[^:\n]*?: [^\n]*?section \.text will not fit in region r1\n[^ \n]*?ld[^:\n]*?: [^\n]*?section \.data will not fit in region r2\n[^ \n]*?ld[^:\n]*?: region r1 overflowed by 4 bytes\n[^ \n]*?ld[^:\n]*?: region r2 overflowed by 4 bytes\Z
 
Discarded input sections
#...
Memory\s+Configuration
 
Name\s+Origin\s+Length\s+Attributes
bss\s+0x0+0000\s+0x0+0000\s+xrw
r1\s+0x0+1000\s+0x0+0008\s+xrw
r2\s+0x0+2000\s+0x0+0008\s+xrw
\*default\*\s+0x0+0000\s+0xf+ffff
 
Linker\s+script\s+and\s+memory\s+map
 
\s*0x0+1000\s+_start\s+=\s+0x1000
 
\s*\.bss\s+0x0+0000\s+0x0
\s*\*\(\.bss\)
\s*\.bss\s+0x0+0000\s+0x0\s+.*?
 
\s*\.text\s+0x0+1000\s+0xc
\s*\*\(\.txt\)
\s*\.txt\s+0x0+1000\s+0xc\s+.*?
 
\s*\.data\s+0x0+2000\s+0xc
\s*\*\(\.dat\)
\s*\.dat\s+0x0+2000\s+0xc\s+.*?
 
/DISCARD/
\*\(\*\)
LOAD\s+.*?
OUTPUT\(.*?\)
#pass
/empty-orphan.d
0,0 → 1,6
#source: empty-orphan.s
#ld: -T empty-orphan.t
#readelf: -l --wide
#...
+LOAD +[x0-9a-f]+ [x0]+70000000 [x0]+70000000 [x0]+(2|4|8|10|20|40|80) .*
#pass
/sort_b_n_a.t
0,0 → 1,5
SECTIONS
{
.text : {*(SORT_BY_NAME(SORT_BY_ALIGNMENT(.text*)))}
/DISCARD/ : { *(.*) }
}
/dynamic-sections-1.s
0,0 → 1,2
.data
.4byte foo
/rgn-over7.d
0,0 → 1,36
# name: rgn-over7
# source: rgn-over.s
# ld: -T rgn-over7.t -Map tmpdir/rgn-over7.map
# error: \A[^ \n]*?ld[^:\n]*?: [^\n]*?section \.text will not fit in region r1\n[^ \n]*?ld[^:\n]*?: section \.data \[0+1008 -> 0+1013\] overlaps section \.text \[0+1000 -> 0+100b\]\n[^ \n]*?ld[^:\n]*?: region r1 overflowed by 4 bytes\Z
 
Discarded input sections
#...
Memory\s+Configuration
 
Name\s+Origin\s+Length\s+Attributes
bss\s+0x0+0000\s+0x0+0000\s+xrw
r1\s+0x0+1000\s+0x0+0008\s+xrw
r2\s+0x0+1008\s+0x0+000c\s+xrw
\*default\*\s+0x0+0000\s+0xf+ffff
 
Linker\s+script\s+and\s+memory\s+map
 
\s*0x0+1000\s+_start\s+=\s+0x1000
 
\s*\.bss\s+0x0+0000\s+0x0
\s*\*\(\.bss\)
\s*\.bss\s+0x0+0000\s+0x0\s+.*?
 
\s*\.text\s+0x0+1000\s+0xc
\s*\*\(\.txt\)
\s*\.txt\s+0x0+1000\s+0xc\s+.*?
 
\s*\.data\s+0x0+1008\s+0xc
\s*\*\(\.dat\)
\s*\.dat\s+0x0+1008\s+0xc\s+.*?
 
/DISCARD/
\*\(\*\)
LOAD\s+.*?
OUTPUT\(.*?\)
#pass
/weak1.s
0,0 → 1,11
.data
.global foo1
.global sym1
.weak sym2
foo1:
.long sym1
.long sym2
sym1:
.long 0x12121212
sym2:
.long 0x34343434
/dynamic-sections.t
0,0 → 1,11
SECTIONS
{
.data : { *(.data) }
.rodata : { *(.rodata) }
 
/* The .rel* sections are typically placed here, because of the way
elf32.em handles orphaned sections. A bug introduced on 2002-06-10
would cause . to be 0 at this point. */
 
_bar = ASSERT (. > 0, "Bad . value");
}
/overlay-size.d
0,0 → 1,29
# ld: -T overlay-size.t -Map tmpdir/overlay-size.map
# name: overlay size
# objdump: --headers
#
# The .bss[123] LMAs are deliberately blanked out. We can't
# reliably map overlaid sections to segments.
#...
.. \.bss1 +0+010 +0+20000 .*
#...
.. \.bss2 +0+030 +0+20000 .*
#...
.. \.bss3 +0+020 +0+20000 .*
#...
.. \.mtext +0+020 +0+10000 +0+30000 .*
#...
.. \.mbss +0+230 +0+20030 .*
#...
.. \.text1 +0+080 +0+10020 +0+30020 .*
#...
.. \.text2 +0+040 +0+10020 +0+300a0 .*
#...
.. \.text3 +0+020 +0+10020 +0+300e0 .*
#...
.. \.data1 +0+030 +0+20260 +0+30100 .*
#...
.. \.data2 +0+040 +0+20260 +0+30130 .*
#...
.. \.data3 +0+050 +0+20260 +0+30170 .*
#pass
/empty-address-3.s
0,0 → 1,5
.text
.global _start
_start:
.byte 0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0
/rgn-over3.t
0,0 → 1,15
/* Memory region overflow tests: two regions, each too small for the single
section placed there. */
 
MEMORY {
bss (rwx) : ORIGIN = 0, LENGTH = 0
r1 (rwx) : ORIGIN = 0x1000, LENGTH = 8
r2 (rwx) : ORIGIN = 0x2000, LENGTH = 8
}
_start = 0x1000;
SECTIONS {
.bss : { *(.bss) } > bss
.text : { *(.txt) } > r1
.data : { *(.dat) } > r2
/DISCARD/ : { *(*) }
}
/empty-orphan.s
0,0 → 1,4
.section .orphan_data, "a"
# empty but defined
.section .data
.word 0x1111
/empty-orphan.t
0,0 → 1,22
MEMORY
{
default_mem : ORIGIN = 0x0, LENGTH = 0x100000
text_mem : ORIGIN = 0x60000000, LENGTH = 0x100
data_mem : ORIGIN = 0x70000000, LENGTH = 0x100
}
 
PHDRS
{
default_phdr PT_LOAD;
text_phdr PT_LOAD;
data_phdr PT_LOAD;
}
 
SECTIONS
{
.text : { *(.text) } > text_mem : text_phdr
.data : { *(.data) } > data_mem : data_phdr
.bss : { *(.bss) } > data_mem : data_phdr
/DISCARD/ : { *(.reginfo) *(.glue*) }
/* .orphan_data is an orphan */
}
/default-script.s
0,0 → 1,3
.text
text:
.long 0
/default-script.t
0,0 → 1,7
_START = DEFINED(_START) ? _START : 0x9000000;
SECTIONS
{
. = _START;
.text : {*(.text)}
/DISCARD/ : {*(*)}
}
/rgn-over7.t
0,0 → 1,14
/* Memory region overflow tests: overflow r1 plus text/data collision. */
 
MEMORY {
bss (rwx) : ORIGIN = 0, LENGTH = 0
r1 (rwx) : ORIGIN = 0x1000, LENGTH = 8
r2 (rwx) : ORIGIN = 0x1008, LENGTH = 12
}
_start = 0x1000;
SECTIONS {
.bss : { *(.bss) } > bss
.text : { *(.txt) } > r1
.data : { *(.dat) } > r2
/DISCARD/ : { *(*) }
}
/provide-3.d
0,0 → 1,3
#source: provide-3.s
#ld: -T provide-3.t
#error: symbol defined in linker script and object file
/overlay-size.s
0,0 → 1,25
.section .bss1, "aw", "nobits"
.space 0x10
.section .bss2, "aw", "nobits"
.space 0x30
.section .bss3, "aw", "nobits"
.space 0x20
 
.section .text1, "ax", "progbits"
.space 0x80
.section .text2, "ax", "progbits"
.space 0x40
.section .text3, "ax", "progbits"
.space 0x20
 
.section .data1, "aw", "progbits"
.space 0x30
.section .data2, "aw", "progbits"
.space 0x40
.section .data3, "aw", "progbits"
.space 0x50
 
.section .mtext, "ax", "progbits"
.space 0x20
.section .mbss, "aw", "nobits"
.space 0x30
/overlay-size.t
0,0 → 1,58
MEMORY
{
TEXTMEM (ARX) : ORIGIN = 0x10000, LENGTH = 32K
DATAMEM (AW) : ORIGIN = 0x20000, LENGTH = 32K
LOADMEM (AW) : ORIGIN = 0x30000, LENGTH = 32K
}
 
/* Map should be:
 
SIZE VMA LMA
.bss1 10 20000 20000
.bss2 30 20000 20010
.bss3 20 20000 20040
.mbss 230 20030 20060
 
.mtext 20 10000 30000
.text1 80 10020 30020
.text2 40 10020 300a0
.text3 20 10020 300e0
 
.data1 30 20260 30100
.data2 40 20260 30130
.data3 50 20260 30170 */
 
SECTIONS
{
OVERLAY :
{
.bss1 { *(.bss1) }
.bss2 { *(.bss2) }
.bss3 { *(.bss3) }
} > DATAMEM
 
.mtext : { *(.mtext) } > TEXTMEM AT > LOADMEM
 
.mbss : AT (__load_stop_bss3)
{
*(.mbss)
. += 0x200;
} > DATAMEM
 
OVERLAY :
{
.text1 { *(.text1) }
.text2 { *(.text2) }
.text3 { *(.text3) }
} > TEXTMEM AT > LOADMEM
 
OVERLAY :
{
.data1 { *(.data1) }
.data2 { *(.data2) }
.data3 { *(.data3) }
} > DATAMEM AT > LOADMEM
 
. = 0x8000;
/DISCARD/ : { *(.reginfo) }
}
/default-script4.d
0,0 → 1,9
# source: default-script.s
# ld: --default-script default-script.t -defsym _START=0x8000000
# nm: -n
 
#...
0*8000000 . _START
#...
0*8000000 t text
#pass
/cross3.c
0,0 → 1,7
int i = 4;
 
int
foo ()
{
return i;
}
/defined.s
0,0 → 1,2
.globl defined
.set defined, 1
/align2a.d
0,0 → 1,12
# ld: --defsym data_align=16 -T align2.t
# objdump: --section-headers
 
[^:]+: +file format.*
 
Sections:
Idx +Name +Size +VMA +LMA +File +off +Algn
[ ]+0 +\.text +[^ ]* +0+ +0+ .*
[ ]+CONTENTS, +ALLOC, +LOAD,.* CODE
[ ]+1 +\.data +[^ ]* +0+10 +0+10 .*
[ ]+CONTENTS, +ALLOC, +LOAD, +DATA
#pass
/rgn-over.s
0,0 → 1,9
.section .txt, "ax", "progbits"
.4byte 0x11223344
.4byte 0x55667788
.4byte 0x99aabbcc
 
.section .dat, "aw", "progbits"
.4byte 0x01020304
.4byte 0x05060708
.4byte 0x090a0b0c
/defined.t
0,0 → 1,7
SECTIONS {
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss) *(COMMON) }
}
value1 = DEFINED (defined) ? 1 : 2;
value2 = DEFINED (undefined) ? 1 : 2;
/dynamic-sections.exp
0,0 → 1,27
# Copyright 2007 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# Check for bug introduced on 2002-06-10. See dynamic-sections.t for
# more details
 
if ![is_elf_format] {
return
}
 
run_dump_test dynamic-sections
/empty-address-3b.d
0,0 → 1,8
#source: empty-address-3.s
#ld: -T empty-address-3b.t
#nm: -n
#...
0+0 T _start
#...
0+10 A __data_end
#pass
/script.s
0,0 → 1,8
.text
.globl text_symbol
text_symbol:
.long 1
.data
.globl data_symbol
data_symbol:
.long 2
/script.t
0,0 → 1,16
SECTIONS
{
.text 0x100 : {
text_start = .;
*(.text)
*(.pr)
text_end = .;
}
. = 0x1000;
.data : {
data_start = .;
*(.data)
*(.rw)
data_end = .;
}
}
/extern.s
0,0 → 1,16
.text
/extern.t
0,0 → 1,14
 
EXTERN(sym1)
EXTERN(sym2, sym3)
EXTERN(sym4 sym5)
 
PROVIDE(sym1 = 1);
PROVIDE(sym2 = 2);
PROVIDE(sym3 = 3);
PROVIDE(sym4 = 4);
PROVIDE(sym5 = 5);
 
SECTIONS
{
}
/sort_b_a_a-1.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_a_a.t
#name: SORT_BY_ALIGNMENT(SORT_BY_ALIGNMENT())
#nm: -n
 
0[0-9a-f]* t text3b
0[0-9a-f]* t text3a
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
/provide-3.s
0,0 → 1,4
.data
.globl foo
foo: .long 0
.p2align 4
/provide-3.t
0,0 → 1,11
SECTIONS
{
.data :
{
LONG (foo)
LONG (bar)
*(.data)
}
foo = .;
bar = .;
}
/alignof.exp
0,0 → 1,67
# Test ALIGNOF in a linker script.
# Copyright 2007 Free Software Foundation, Inc.
# Contributed by Nathan Sidwell <nathan@codesourcery.com>
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# Only ELF and PE-COFF targets record section alignment.
 
if {![is_elf_format] && ![is_pecoff_format]} {
return
}
 
set testname "ALIGNOF"
 
if ![ld_assemble $as $srcdir/$subdir/alignof.s tmpdir/alignof.o] {
unresolved $testname
return
}
 
if ![ld_simple_link $ld tmpdir/alignof "-T $srcdir/$subdir/alignof.t tmpdir/alignof.o"] {
fail $testname
return
}
 
if ![ld_nm $nm "" tmpdir/alignof] {
unresolved $testname
return
}
 
if {![info exists nm_output(alignof_text)] \
|| ![info exists nm_output(alignof_data)]} {
send_log "bad output from nm\n"
verbose "bad output from nm"
fail $testname
return
}
 
if {$nm_output(alignof_text) != 64} {
send_log "alignof_text != 64\n"
verbose "alignof_text != 64"
fail $testname
return
}
 
if {$nm_output(alignof_data) != 16} {
send_log "alignof_data != 16\n"
verbose "alignof_data != 16"
fail $testname
return
}
 
pass $testname
/cross3.t
0,0 → 1,10
NOCROSSREFS(.nocrossrefs .text)
 
SECTIONS
{
.text : { *(.text) }
.nocrossrefs : { *(.nocrossrefs) }
.data : { *(.data) *(.opd) }
.bss : { *(.bss) *(COMMON) }
/DISCARD/ : { *(*) }
}
/align2a.s
0,0 → 1,4
.text
.long 0
.data
.long 0x12345678
/rgn-over8-ok.d
0,0 → 1,12
# name: rgn-over8
# source: rgn-over8.s
# ld: -T rgn-over8.t
# objdump: -w -h
 
.*: file format .*
 
Sections:
Idx +Name +Size +VMA +LMA +File off +Algn +Flags
0 .text 0+0000400 0+0000000 0+0000000 [0-9a-f]+ 2\*\*[0-9]+ CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 0+0000400 0+0001000 0+0000400 [0-9a-f]+ 2\*\*[0-9]+ CONTENTS, ALLOC, LOAD, DATA
2 .bss 0+0000400 0+0001400 0+0000800 [0-9a-f]+ 2\*\*[0-9]+ ALLOC
/weak.exp
0,0 → 1,81
# Test weak symbols.
# By Ian Lance Taylor, Cygnus Solutions.
# Copyright 1999, 2000, 2002, 2004, 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set testname "weak symbols"
 
# This test only works for ELF targets.
# It ought to work for some a.out targets, but it doesn't.
if {! [is_elf_format] && ! [is_pecoff_format]} {
unsupported $testname
return
}
 
# Weak symbols are broken for non-i386 PE targets.
if {! [istarget i?86-*-*]} {
setup_xfail *-*-pe*
setup_xfail x86_64-*-mingw*
}
 
# hppa64 and or32 are incredibly broken
setup_xfail hppa64-*-* or32-*-*
 
if {! [ld_assemble $as $srcdir/$subdir/weak1.s tmpdir/weak1.o]
|| ! [ld_assemble $as $srcdir/$subdir/weak2.s tmpdir/weak2.o]} then {
# It's OK if .weak doesn't work on this target.
unresolved $testname
return
}
 
global LDFLAGS
set saved_LDFLAGS "$LDFLAGS"
if [istarget "x86_64-*-mingw*"] then {
set LDFLAGS "$LDFLAGS --image-base 0"
}
 
set weak_regexp_big \
".*Contents of section .text:.*1000 00001008 0000200c 12121212 34343434.*Contents of section .data:.*2000 00001008 0000200c 56565656 78787878.*"
 
set weak_regexp_little \
".*Contents of section .text:.*1000 08100000 0c200000 12121212 34343434.*Contents of section .data:.*2000 08100000 0c200000 56565656 78787878.*"
 
if {! [ld_simple_link $ld tmpdir/weak "$flags -T $srcdir/$subdir/weak.t tmpdir/weak1.o tmpdir/weak2.o"] } then {
fail $testname
} else {
if {![is_remote host] && [which $objdump] == 0} then {
unresolved $testname
set LDFLAGS "$saved_LDFLAGS"
return
}
 
set exec_output [run_host_cmd "$objdump" "-s tmpdir/weak"]
set exec_output [prune_warnings $exec_output]
verbose -log $exec_output
 
if {[regexp $weak_regexp_big $exec_output] \
|| [regexp $weak_regexp_little $exec_output] } then {
pass $testname
} else {
fail $testname
}
}
 
set LDFLAGS "$saved_LDFLAGS"
/overlay-size.exp
0,0 → 1,34
# Test the OVERLAY statement.
# Copyright 2002, 2007 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
if ![is_elf_format] {
return
}
 
run_dump_test overlay-size
 
set testname "overlay size (map check)"
 
if [regexp_diff "tmpdir/overlay-size.map" \
"$srcdir/$subdir/overlay-size-map.d"] {
fail $testname
} else {
pass $testname
}
/empty-address-3b.t
0,0 → 1,11
SECTIONS
{
.text 0x00000000: { *(.text) }
.data ALIGN(0x1000) + (. & (0x1000 - 1)):
{
PROVIDE (__data_start = .);
*(.data)
}
__data_end = .;
/DISCARD/ : { *(.*) }
}
/align.exp
0,0 → 1,57
# Test ALIGN in a linker script.
# By Nathan Sidwell, CodeSourcery LLC
# Copyright 2004, 2005, 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
if [istarget "rs6000-*-aix*"] {
# Target maps .text and .data to other sections.
return
}
 
set testname "align1"
 
if ![ld_assemble $as $srcdir/$subdir/align.s tmpdir/align.o] {
unresolved $testname
return
}
 
# mingw on x86_64 targets need to set the image base to 0 to avoid auto image-basing.
global LDFLAGS
set saved_LDFLAGS "$LDFLAGS"
if [istarget "x86_64-*-mingw*"] then {
set LDFLAGS "$LDFLAGS --image-base 0"
}
 
if ![ld_simple_link $ld tmpdir/align "$LDFLAGS -T $srcdir/$subdir/align.t tmpdir/align.o"] {
fail $testname
} else {
pass $testname
}
 
if ![is_aout_format] {
# The z80-coff port defaults to a "binary" like output
# file format which does not include a data section.
setup_xfail "z80-*-coff"
run_dump_test align2a
setup_xfail "z80-*-coff"
run_dump_test align2b
}
run_dump_test align2c
set LDFLAGS "$saved_LDFLAGS"
/sort_b_n_a-2.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_n_a.t --sort-section name
#name: SORT_BY_NAME(SORT_BY_ALIGNMENT()) --sort-section alignment
#nm: -n
 
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
0[0-9a-f]* t text3b
0[0-9a-f]* t text3a
/sort_b_a_n-3.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_a_n.t --sort-section alignment
#name: SORT_BY_ALIGNMENT(SORT_BY_NAME()) --sort-section alignment
#nm: -n
 
0[0-9a-f]* t text3b
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text3a
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
/size-1.d
0,0 → 1,14
#source: size-1.s
#ld: -T size-1.t
#objdump: -s
 
.*: file format .*
 
#...
Contents of section \.text:
[0-9a-f]* (01)?000000(01)? (02)?000000(02)? .*
#...
Contents of section \.data:
[0-9a-f]* (03)?000000(03)? (04)?000000(04)? (05)?000000(05)? 00000000 .*
[0-9a-f]* (20)?000000(20)? (18)?000000(18)? .*
#pass
/data.d
0,0 → 1,9
#source: data.s
#ld: -T data.t
#objdump: -s -j .text
 
.*: file format .*
 
Contents of section .text:
[0-9a-f]* (04)?000000(04)? (0020)?0000(2000)? .*
#pass
/extern.exp
0,0 → 1,71
# Test EXTERN in a linker script.
# By Nathan Sidwell, CodeSourcery LLC
# Copyright 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set testname "EXTERN"
 
if ![ld_assemble $as $srcdir/$subdir/extern.s tmpdir/extern.o] {
unresolved $testname
return
}
 
if ![ld_simple_link $ld tmpdir/extern "-T $srcdir/$subdir/extern.t tmpdir/extern.o"] {
fail $testname
}
 
if ![ld_nm $nm "" tmpdir/extern] {
unresolved $testname
return
}
 
if {![info exists nm_output(sym1)] || $nm_output(sym1) != 1} {
send_log "sym1 wrong\n"
verbose "sym1 wrong"
fail $testname
return
}
if {![info exists nm_output(sym2)] || $nm_output(sym2) != 2} {
send_log "sym1 wrong\n"
verbose "sym1 wrong"
fail $testname
return
}
if {![info exists nm_output(sym3)] || $nm_output(sym3) != 3} {
send_log "sym1 wrong\n"
verbose "sym1 wrong"
fail $testname
return
}
if {![info exists nm_output(sym4)] || $nm_output(sym4) != 4} {
send_log "sym1 wrong\n"
verbose "sym1 wrong"
fail $testname
return
}
if {![info exists nm_output(sym5)] || $nm_output(sym5) != 5} {
send_log "sym1 wrong\n"
verbose "sym1 wrong"
fail $testname
return
}
 
pass $testname
/sort_no-2.d
0,0 → 1,9
#source: sort_b_a.s
#ld: -T sort_no.t
#name: no SORT_BY_NAME/SORT_BY_ALIGNMENT/SORT
#nm: -n
 
0[0-9a-f]* t text
0[0-9a-f]* t text2
0[0-9a-f]* t text3
0[0-9a-f]* t text1
/rgn-over4.d
0,0 → 1,36
# name: rgn-over4
# source: rgn-over.s
# ld: -T rgn-over4.t -Map tmpdir/rgn-over4.map
# error: \A[^ \n]*?ld[^:\n]*?: [^:\n]*?section \.text will not fit in region r1\n[^ \n]*?ld[^:\n]*?: region r1 overflowed by 16 bytes\Z
 
Discarded input sections
#...
Memory\s+Configuration
 
Name\s+Origin\s+Length\s+Attributes
bss\s+0x0+0000\s+0x0+0000\s+xrw
r1\s+0x0+1000\s+0x0+0008\s+xrw
v1\s+0x0+2000\s+0x0+0018\s+xrw
\*default\*\s+0x0+0000\s+0xf+ffff
 
Linker\s+script\s+and\s+memory\s+map
 
\s*0x0+1000\s+_start\s+=\s+0x1000
 
\s*\.bss\s+0x0+0000\s+0x0
\s*\*\(\.bss\)
\s*\.bss\s+0x0+0000\s+0x0\s+.*?
 
\s*\.text\s+0x0+1000\s+0xc\s+load\s+address\s+0x0+2000
\s*\*\(\.txt\)
\s*\.txt\s+0x0+1000\s+0xc\s+.*?
 
\s*\.data\s+0x0+100c\s+0xc\s+load\s+address\s+0x0+200c
\s*\*\(\.dat\)
\s*\.dat\s+0x0+100c\s+0xc\s+.*?
 
/DISCARD/
\*\(\*\)
LOAD\s+.*?
OUTPUT\(.*?\)
#pass
/sort_b_a-1.d
0,0 → 1,9
#source: sort_b_a-1.s
#ld: -T sort.t --sort-section alignment
#name: --sort-section alignment
#nm: -n
 
0[0-9a-f]* t text3
0[0-9a-f]* t text1
0[0-9a-f]* t text
0[0-9a-f]* t text2
/dynamic-sections-2.s
0,0 → 1,3
.data
.global foo
foo: .4byte 0
/size-1.s
0,0 → 1,7
.text
.long 1,2
.p2align 5
 
.data
.long 3,4,5
.p2align 4
/weak2.s
0,0 → 1,11
.data
.global foo2
.weak sym1
.global sym2
foo2:
.long sym1
.long sym2
sym1:
.long 0x56565656
sym2:
.long 0x78787878
/data.s
0,0 → 1,11
 
/memory.t
0,0 → 1,39
MEMORY
{
TEXTMEM (ARX) : ORIGIN = 0x100, LENGTH = 32K
DATAMEM (AW) : org = 0x1000, l = (64 * 1024)
}
 
SECTIONS
{
. = 0;
.text :
{
/* The value returned by the ORIGIN operator is a constant.
However it is being assigned to a symbol declared within
a section. Therefore the symbol is section-relative and
its value will include the offset of that section from
the start of memory. ie the declaration:
text_start = ORIGIN (TEXTMEM);
here will result in text_start having a value of 0x200.
Hence we need to subtract the absolute value of the
location counter at this point in order to give text_start
a value that is truely absolute, and which coincidentally
will allow the tests in script.exp to work. */
text_start = ORIGIN(TEXTMEM) - ABSOLUTE (.);
*(.text)
*(.pr)
text_end = .;
} > TEXTMEM
data_start = ORIGIN (DATAMEM);
.data :
{
*(.data)
*(.rw)
data_end = .;
} >DATAMEM
 
fred = ORIGIN(DATAMEM) + LENGTH(DATAMEM);
}
/size-1.t
0,0 → 1,10
SECTIONS
{
. = 0x1000 + SIZEOF_HEADERS;
.text ALIGN (0x20) : { *(.text) }
.data 0x2000 : {
*(.data)
LONG (SIZEOF (.text))
LONG (SIZEOF (.data))
}
}
/data.t
0,0 → 1,11
SECTIONS
{
. = 0x1000 + SIZEOF_HEADERS;
.text ALIGN (0x20) :
{
LONG (label - .)
label = .;
LONG (ADDR (.other))
}
.other 0x2000 : {}
}
/sort_b_n_n.t
0,0 → 1,5
SECTIONS
{
.text : {*(SORT_BY_NAME(SORT_BY_NAME(.text*)))}
/DISCARD/ : { *(.*) }
}
/rgn-over4.t
0,0 → 1,14
/* Memory region overflow tests: overflow VMA but not LMA. */
 
MEMORY {
bss (rwx) : ORIGIN = 0, LENGTH = 0
r1 (rwx) : ORIGIN = 0x1000, LENGTH = 8
v1 (rwx) : ORIGIN = 0x2000, LENGTH = 24
}
_start = 0x1000;
SECTIONS {
.bss : { *(.bss) } > bss
.text : { *(.txt) } > r1 AT> v1
.data : { *(.dat) } > r1 AT> v1
/DISCARD/ : { *(*) }
}
/sort_b_a-1.s
0,0 → 1,16
.section .text.2
.p2align 3
text2:
.long 0
.section .text.3
.p2align 6
text3:
.long 0
.section .text.1
.p2align 5
text1:
.long 0
.text
text:
.p2align 4
.long 0
/rgn-over8.s
0,0 → 1,7
.text
.globl main
.zero 1024
.data
.zero 1024
.section .bss, "aw", "nobits"
.zero 1024
/rgn-over8.t
0,0 → 1,13
/* Memory region overflow tests: bss to LMA doesn't cause overflow. */
 
MEMORY {
rom (rwx) : ORIGIN = 0, LENGTH = 2048
ram (rwx) : ORIGIN = 0x1000, LENGTH = 2048
}
_start = 0x0;
SECTIONS {
.text : { *(.text) } >rom AT>rom
.data : { *(.data) } >ram AT>rom
.bss : { *(.bss) } >ram AT>rom
/DISCARD/ : { *(*) }
}
/default-script1.d
0,0 → 1,9
# source: default-script.s
# ld: -defsym _START=0x8000000 -T default-script.t
# nm: -n
 
#...
0*8000000 . _START
#...
0*8000000 t text
#pass
/sizeof.exp
0,0 → 1,74
# Test SIZEOF in a linker script.
# By Ian Lance Taylor, Cygnus Support
# Based on a bug report from anders.blomdell@control.lth.se.
# Copyright 2001, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set testname "SIZEOF"
 
if ![ld_assemble $as $srcdir/$subdir/sizeof.s tmpdir/sizeof.o] {
unresolved $testname
return
}
 
if ![ld_simple_link $ld tmpdir/sizeof "-T $srcdir/$subdir/sizeof.t tmpdir/sizeof.o"] {
fail $testname
return
}
 
if ![ld_nm $nm "" tmpdir/sizeof] {
unresolved $testname
return
}
 
if {![info exists nm_output(text_start)] \
|| ![info exists nm_output(text_end)] \
|| ![info exists nm_output(data_start)] \
|| ![info exists nm_output(data_end)] \
|| ![info exists nm_output(sizeof_text)] \
|| ![info exists nm_output(sizeof_data)]} {
send_log "bad output from nm\n"
verbose "bad output from nm"
fail $testname
return
}
 
if {$nm_output(text_end) - $nm_output(text_start) != $nm_output(sizeof_text)} {
send_log "text_end - text_start != sizeof_text\n"
verbose "text_end - text_start != sizeof_text"
fail $testname
return
}
 
if {$nm_output(data_end) - $nm_output(data_start) != $nm_output(sizeof_data)} {
send_log "data_end - data_start != sizeof_data\n"
verbose "data_end - data_start != sizeof_data"
fail $testname
return
}
 
if {$nm_output(sizeof_text) != $nm_output(sizeof_data)} {
send_log "sizeof_text != sizeof_data\n"
verbose "sizeof_text != sizeof_data"
fail $testname
return
}
 
pass $testname
/cross4.c
0,0 → 1,7
__attribute__ ((section (".nocrossrefs")))
static void
foo ()
{
}
 
void (*dummy) () = foo;
/align2b.d
0,0 → 1,12
# ld: --defsym data_align=32 -T align2.t
# objdump: --section-headers
 
[^:]+: +file +format.*
 
Sections:
Idx +Name +Size +VMA +LMA +File off +Algn
+0 +\.text +[^ ]* +0+ +0+ .*
+CONTENTS, +ALLOC, +LOAD,.* CODE
+1 +\.data +[^ ]* +0+20 +0+20 .*
+CONTENTS, +ALLOC, +LOAD, +DATA
#pass
/phdrs2.s
0,0 → 1,7
.section .foo, "ax"
.p2align 2
.long 1
 
.section .bar, "aw"
.p2align 2
.long 2
/phdrs2.t
0,0 → 1,23
PHDRS
{
Foo PT_LOAD ;
Bar PT_LOAD ;
}
 
SECTIONS
{
. = 0x800000 - 1;
/* The PHDRS generated should start at the aligned .foo section
address, not the unaligned .empty section address */
.empty : {
EMPTY_START = ABSOLUTE(.) ;
*(.empty)
EMPTY_END = ABSOLUTE(.) ;
} : Foo
.foo : { *(.foo) } : Foo
.bar : { *(.bar)
LONG(EMPTY_START) ;
} : Bar
/DISCARD/ : { *(.*) }
}
/data.exp
0,0 → 1,30
# Test DATA STATEMENT in a linker script.
# By Nathan Sidwell, CodeSourcery LLC
# Copyright 2004, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# An a.out "objdump -s -j .text" has the file header visible inside the
# text segment, confusing run_dump_test.
if {[is_aout_format]} {
unsupported data
return
}
 
run_dump_test data
/size.exp
0,0 → 1,41
# Expect script for SIZEOF tests
# Copyright (C) 2004, 2007 Free Software Foundation
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
#
 
# AIX maps .text and .data to other sections.
# a.out objdump displays the file header inside the text segment,
# confusing run_dump_test.
 
if {[istarget "rs6000-*-aix*"] || [is_aout_format]} {
unsupported size-1
unsupported size-2
return
}
 
run_dump_test size-1
 
# size-2 only works on ELF targets.
# MIPS inserts a REGINFO PHDR
if {![is_elf_format] || [istarget "mips*-*-*"]} {
unsupported size-2
return
}
 
run_dump_test size-2
/empty-address-3c.d
0,0 → 1,10
#source: empty-address-3.s
#ld: -T empty-address-3c.t
#nm: -n
#...
0+0 T _start
#...
0+1010 A __data_end
#...
0+1010 [ADT] __data_start
#pass
/sort_b_a_a-2.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_a_a.t --sort-section alignment
#name: SORT_BY_ALIGNMENT(SORT_BY_ALIGNMENT()) --sort-section alignment
#nm: -n
 
0[0-9a-f]* t text3b
0[0-9a-f]* t text3a
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
/phdrs.exp
0,0 → 1,68
# Test PHDRS in a linker script.
# By Ian Lance Taylor, Cygnus Support.
# Copyright 1999, 2000, 2001, 2002, 2003, 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# PHDRS is only meaningful for ELF.
if ![is_elf_format] {
return
}
 
# This is a very simplistic test.
 
set testname "PHDRS"
 
set ldopt ""
if { [istarget spu*-*-*] } {
set ldopt "--local-store 0:0"
}
 
if ![ld_assemble $as $srcdir/$subdir/phdrs.s tmpdir/phdrs.o] {
unresolved $testname
return
}
 
set phdrs_regexp \
".*Program Header:.*PHDR *off *0x00*34 *vaddr *0x00*800034 *paddr *0x00*800034.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* flags r--.*LOAD *off *0x00* *vaddr *0x00*800000 *paddr *0x00*800000.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags r-x.*LOAD *off *0x0\[0-9a-f\]* *vaddr *0x00*80*\[0-9a-f\]* *paddr *0x00*80*\[0-9a-f\]*.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags *rw-.*"
 
# On a 64 bit ELF format, we need different numbers.
if [is_elf64 tmpdir/phdrs.o] {
set phdrs_regexp \
".*Program Header:.*PHDR *off *0x00*40 *vaddr *0x00*800040 *paddr *0x00*800040.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* flags r--.*LOAD *off *0x00* *vaddr *0x00*800000 *paddr *0x00*800000.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags r-x.*LOAD *off *0x0\[0-9a-f\]* *vaddr *0x00*80*\[0-9a-f\]* *paddr *0x00*80*\[0-9a-f\]*.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags *rw-.*"
}
 
set ldopt "$ldopt -T $srcdir/$subdir/phdrs.t tmpdir/phdrs.o"
if ![ld_simple_link $ld tmpdir/phdrs $ldopt] {
fail $testname
} else {
if {![is_remote host] && [which $objdump] == 0} {
unresolved $testname
return
}
set exec_output [run_host_cmd "$objdump" "--private tmpdir/phdrs"]
set exec_output [prune_warnings $exec_output]
verbose -log $exec_output
 
if [regexp $phdrs_regexp $exec_output] {
pass $testname
} else {
fail $testname
}
}
/align2b.s
0,0 → 1,4
.text
.long 0
.data
.long 0x12345678
/default-script.exp
0,0 → 1,32
# Test --default-script/-dT
# Copyright 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
if { [istarget spu*-*-*] } {
set LDFLAGS "$LDFLAGS --local-store 0:0"
}
 
set test_list [lsort [glob -nocomplain $srcdir/$subdir/default-script*.d]]
foreach t $test_list {
# We need to strip the ".d", but can leave the dirname.
verbose [file rootname $t]
run_dump_test [file rootname $t]
}
 
/sort.exp
0,0 → 1,34
# Test SORT_BY_NAME/SORT_BY_ALIGNMENT/SORT in a linker script.
# By H.J. Lu <hongjiu.lu@intel.com>
# Copyright 2004, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# FIXME: The expected outputs are correct only for ELF.
if ![is_elf_format] {
return
}
 
load_lib ld-lib.exp
 
set sort_test_list [lsort [glob -nocomplain $srcdir/$subdir/sort*.d]]
for { set i 0 } { $i < [llength $sort_test_list] } { incr i } {
verbose [file rootname [lindex $sort_test_list $i]]
run_dump_test [file rootname [lindex $sort_test_list $i]]
}
/scriptm.t
0,0 → 1,10
* MRI script
sect .text = $100 ; .text start address
sect .data = 1000h ; .data start address
public text_start = $100
public text_end = # continuation line
text_start + 4
public data_start = 1000h
public data_end = data_start + 4
 
load tmpdir/script.o
/overlay-size-map.d
0,0 → 1,23
#...
\.bss1 *0x0*20000 *0x10
#...
\.bss2 *0x0*20000 *0x30 load address 0x0*20010
#...
\.bss3 *0x0*20000 *0x20 load address 0x0*20040
#...
\.mtext *0x0*10000 *0x20 load address 0x0*30000
#...
\.mbss *0x0*20030 *0x230 load address 0x0*20060
#...
\.text1 *0x0*10020 *0x80 load address 0x0*30020
#...
\.text2 *0x0*10020 *0x40 load address 0x0*300a0
#...
\.text3 *0x0*10020 *0x20 load address 0x0*300e0
#...
\.data1 *0x0*20260 *0x30 load address 0x0*30100
#...
\.data2 *0x0*20260 *0x40 load address 0x0*30130
#...
\.data3 *0x0*20260 *0x50 load address 0x0*30170
#pass
/empty-address-3c.t
0,0 → 1,11
SECTIONS
{
.text 0x00000000: { *(.text) }
.data ALIGN(0x1000) + (. & (0x1000 - 1)):
{
__data_start = .;
*(.data)
}
__data_end = .;
/DISCARD/ : { *(.*) }
}
/sort_b_n_a-3.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_n_a.t --sort-section alignment
#name: SORT_BY_NAME(SORT_BY_ALIGNMENT()) --sort-section alignment
#nm: -n
 
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
0[0-9a-f]* t text3b
0[0-9a-f]* t text3a
/defined.exp
0,0 → 1,69
# Test DEFINED in a linker script.
# By Ian Lance Taylor, Cygnus Support.
# Copyright 2001, 2003. 2006, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
set testname "DEFINED"
set prms_id 5699
 
if ![ld_assemble $as $srcdir/$subdir/defined.s tmpdir/def.o] {
unresolved $testname
return
}
 
global LDFLAGS
set saved_LDFLAGS "$LDFLAGS"
if [istarget "x86_64-*-mingw*"] then {
set LDFLAGS "$LDFLAGS --image-base 0"
}
 
if ![ld_simple_link $ld tmpdir/def "$LDFLAGS -T $srcdir/$subdir/defined.t tmpdir/def.o"] {
fail $testname
} else {
if ![ld_nm $nm "" tmpdir/def] {
unresolved $testname
} else {
if {![info exists nm_output(value1)] \
|| ![info exists nm_output(value2)]} {
send_log "bad output from nm\n"
verbose "bad output from nm"
fail $testname
} else {
if {$nm_output(value1) != 1} {
send_log "value1 == $nm_output(value1)\n"
verbose "value1 == $nm_output(value1)"
fail $testname
} else {
if {$nm_output(value2) != 2} {
send_log "value2 == $nm_output(value2)\n"
verbose "value2 == $nm_output(value2)"
fail $testname
} else {
pass $testname
}
}
}
}
}
 
set prms_id 0
run_dump_test "defined2"
run_dump_test "defined3"
set LDFLAGS "$saved_LDFLAGS"
/sort_b_a_a.t
0,0 → 1,5
SECTIONS
{
.text : {*(SORT_BY_ALIGNMENT(SORT_BY_ALIGNMENT(.text*)))}
/DISCARD/ : { *(.*) }
}
/empty-aligned.exp
0,0 → 1,29
# Make sure empty aligned sections do not change output layout.
# Copyright 2005, 2007
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
 
# PHDRS is only meaningful for ELF.
if ![is_elf_format] {
return
}
 
set testname "empty-aligned"
 
run_dump_test empty-aligned
/size-2.d
0,0 → 1,18
#source: size-2.s
#ld: -T size-2.t
#readelf: -l --wide
#xfail: "hppa64-*-*" "v850-*-*"
 
#...
Program Headers:
+Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align
+PHDR +0x[0-9a-f]+ 0x0+0000 0x0+0000 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x[0-9a-f]+
#...
+LOAD +0x[0-9a-f]+ 0x0+0100 0x0+0100 0x0+0030 0x0+0030 R E +0x[0-9a-f]+
+TLS +0x[0-9a-f]+ 0x0+0108 0x0+0108 0x0+0014 0x0+002c R +0x[0-9a-f]+
 
Section to Segment mapping:
+Segment Sections\.\.\.
+00 .*
+01.*\.text.*\.tdata.*
+02.*\.tdata.*
/empty-address-1.d
0,0 → 1,8
#ld: -T empty-address-1.t
#nm: -n
#...
0+0 T _start
#...
0+2000000 A __data_end
0+2000000 [ADT] __data_start
#pass
/sort_b_n_n-1.d
0,0 → 1,14
#source: sort_n_a-a.s
#source: sort_n_a-b.s
#ld: -T sort_b_n_n.t
#name: SORT_BY_NAME(SORT_BY_NAME())
#nm: -n
 
0[0-9a-f]* t texta
0[0-9a-f]* t textb
0[0-9a-f]* t text1a
0[0-9a-f]* t text1b
0[0-9a-f]* t text2a
0[0-9a-f]* t text2b
0[0-9a-f]* t text3a
0[0-9a-f]* t text3b
/rgn-over1.d
0,0 → 1,35
# name: rgn-over1
# source: rgn-over.s
# ld: -T rgn-over1.t -Map tmpdir/rgn-over1.map
# error: \A[^ \n]*?ld[^:\n]*?: [^\n]*?section \.text will not fit in region r1\n[^ \n]*?ld[^:\n]*?: region r1 overflowed by 16 bytes\Z
 
Discarded input sections
#...
Memory\s+Configuration
 
Name\s+Origin\s+Length\s+Attributes
bss\s+0x0+0000\s+0x0+0000\s+xrw
r1\s+0x0+1000\s+0x0+0008\s+xrw
\*default\*\s+0x0+0000\s+0xf+ffff
 
Linker\s+script\s+and\s+memory\s+map
 
\s*0x0+1000\s+_start\s+=\s+0x1000
 
\s*\.bss\s+0x0+0000\s+0x0
\s*\*\(\.bss\)
\s*\.bss\s+0x0+0000\s+0x0\s+.*?
 
\s*\.text\s+0x0+1000\s+0xc
\s*\*\(\.txt\)
\s*\.txt\s+0x0+1000\s+0xc\s+.*?
 
\s*\.data\s+0x0+100c\s+0xc
\s*\*\(\.dat\)
\s*\.dat\s+0x0+100c\s+0xc\s+.*?
 
/DISCARD/
\*\(\*\)
LOAD\s+.*?
OUTPUT\(.*?\)
#pass
/empty-address-2a.d
0,0 → 1,8
#source: empty-address-2.s
#ld: -Ttext 0x0000000 -Tdata 0x2000000 -T empty-address-2a.t
#nm: -n
#...
0+0 T _start
#...
0+10 A __data_end
#pass
/rgn-over5.d
0,0 → 1,36
# name: rgn-over5
# source: rgn-over.s
# ld: -T rgn-over5.t -Map tmpdir/rgn-over5.map
# error: \A[^ \n]*?ld[^:\n]*?: [^\n]*?section \.text will not fit in region v1\n[^ \n]*?ld[^:\n]*?: region v1 overflowed by 16 bytes\Z
 
Discarded input sections
#...
Memory\s+Configuration
 
Name\s+Origin\s+Length\s+Attributes
bss\s+0x0+0000\s+0x0+0000\s+xrw
r1\s+0x0+1000\s+0x0+0018\s+xrw
v1\s+0x0+2000\s+0x0+0008\s+xrw
\*default\*\s+0x0+0000\s+0xf+ffff
 
Linker\s+script\s+and\s+memory\s+map
 
\s*0x0+1000\s+_start\s+=\s+0x1000
 
\s*\.bss\s+0x0+0000\s+0x0
\s*\*\(\.bss\)
\s*\.bss\s+0x0+0000\s+0x0\s+.*?
 
\s*\.text\s+0x0+1000\s+0xc\s+load\s+address\s+0x0+2000
\s*\*\(\.txt\)
\s*\.txt\s+0x0+1000\s+0xc\s+.*?
 
\s*\.data\s+0x0+100c\s+0xc\s+load\s+address\s+0x0+200c
\s*\*\(\.dat\)
\s*\.dat\s+0x0+100c\s+0xc\s+.*?
 
/DISCARD/
\*\(\*\)
LOAD\s+.*?
OUTPUT\(.*?\)
#pass
/sort_b_a.d
0,0 → 1,9
#source: sort_b_a.s
#ld: -T sort_b_a.t
#name: SORT_BY_ALIGNMENT
#nm: -n
 
0[0-9a-f]* t text3
0[0-9a-f]* t text1
0[0-9a-f]* t text
0[0-9a-f]* t text2
/size-2.s
0,0 → 1,8
.text
.long 1,2
 
.section .tdata
.long 6,7,8,9,10
.section .tbss
.long 0,0,0,0,0,0
/size-2.t
0,0 → 1,21
PHDRS
{
header PT_PHDR FILEHDR PHDRS ;
image PT_LOAD FLAGS (5);
tls PT_TLS FLAGS (4);
}
SECTIONS
{
.text 0x100 : { *(.text) } :image
.tdata : { *(.tdata) } :image :tls
.tbss : { *(.tbss) } :image : tls
.map : {
LONG (SIZEOF (.text))
LONG (SIZEOF (.data))
LONG (SIZEOF (.bss))
LONG (SIZEOF (.tdata))
LONG (SIZEOF (.tbss))
} :image
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.