diff options
Diffstat (limited to 'binutils-2.25/ld/testsuite/ld-elf')
86 files changed, 467 insertions, 89 deletions
diff --git a/binutils-2.25/ld/testsuite/ld-elf/audit.exp b/binutils-2.25/ld/testsuite/ld-elf/audit.exp index 407c61af..3b058685 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/audit.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/audit.exp @@ -1,5 +1,5 @@ # Expect script for various ELF tests. -# Copyright 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/binutils.exp b/binutils-2.25/ld/testsuite/ld-elf/binutils.exp index 01015125..4ade8cb8 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/binutils.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/binutils.exp @@ -1,5 +1,5 @@ # Expect script for binutils tests -# Copyright 2006, 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -79,6 +79,30 @@ proc binutils_test { prog_name ld_options test {test_name ""}} { return } + if [string match "*-z relro*" $ld_options] { + # Check if GNU_RELRO segment is generated. + set got [remote_exec host "grep GNU_RELRO tmpdir/$test.exp"] + if { ![string match "*GNU_RELRO*" $got] } then { + set got [remote_exec host "cat tmpdir/$test.exp"] + if { [string match "*.data.rel.ro*" $got] + || [string match "*.dynamic*" $got] + || [string match "*.got*" $got] + || [string match "*.eh_frame*" $got] + || [string match "*.gcc_except_table*" $got] + || [string match "*.exception_ranges*" $got] + || [string match "*.ctors*" $got] + || [string match "*.dtors*" $got] + || [string match "*.tdata*" $got] + || [string match "*.preinit_array*" $got] + || [string match "*.init_array*" $got] + || [string match "*.fini_array*" $got] } then { + # Fail if GNU_RELRO segment isn't generated, but should. + fail "$test_name" + return + } + } + } + send_log "$prog tmpdir/$test\n" set got [remote_exec host "$prog tmpdir/$test"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { diff --git a/binutils-2.25/ld/testsuite/ld-elf/comm-data.exp b/binutils-2.25/ld/testsuite/ld-elf/comm-data.exp index 71613c52..2706bce4 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/comm-data.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/comm-data.exp @@ -1,6 +1,6 @@ # Expect script for common symbol override. # -# Copyright 2011, 2012 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/compress.exp b/binutils-2.25/ld/testsuite/ld-elf/compress.exp index 55269eed..6bfc0401 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/compress.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/compress.exp @@ -1,5 +1,5 @@ # Expect script for ELF compressed debug section tests. -# Copyright 2010 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/compress1.s b/binutils-2.25/ld/testsuite/ld-elf/compress1.s index 8ef0a150..f75c7bea 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/compress1.s +++ b/binutils-2.25/ld/testsuite/ld-elf/compress1.s @@ -1,6 +1,6 @@ /* This testcase is derived from a similar test in GDB. - Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2008-2014 Free Software Foundation, Inc. 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 diff --git a/binutils-2.25/ld/testsuite/ld-elf/dwarf.exp b/binutils-2.25/ld/testsuite/ld-elf/dwarf.exp index c3132360..4ec26f16 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/dwarf.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/dwarf.exp @@ -1,5 +1,5 @@ # Expect script for various DWARF tests. -# Copyright 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.c b/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.c new file mode 100644 index 00000000..439ffd1c --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.c @@ -0,0 +1,10 @@ +void +dynamic () +{ +} + +int +main () +{ + return 0; +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.rd b/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.rd new file mode 100644 index 00000000..2c2f23b0 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.rd @@ -0,0 +1,5 @@ +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +_?dynamic +#... diff --git a/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.syms b/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.syms new file mode 100644 index 00000000..c9517f88 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/dynamic-1.syms @@ -0,0 +1,3 @@ +{ + dynamic; +}; diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh-frame-hdr.d b/binutils-2.25/ld/testsuite/ld-elf/eh-frame-hdr.d index 1122cba4..45a890d8 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh-frame-hdr.d +++ b/binutils-2.25/ld/testsuite/ld-elf/eh-frame-hdr.d @@ -2,7 +2,7 @@ #ld: -e _start --eh-frame-hdr #objdump: -hw #target: cfi -#xfail: avr*-*-* +#xfail: avr*-*-* or1k-*-* # avr doesn't support shared libraries. #... [0-9] .eh_frame_hdr 0*[12][048c] .* diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh-group.exp b/binutils-2.25/ld/testsuite/ld-elf/eh-group.exp index 6fe70583..e0b8f000 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh-group.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/eh-group.exp @@ -1,5 +1,5 @@ # Expect script for .eh_frame entries to a removed section. -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2008-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh1.d b/binutils-2.25/ld/testsuite/ld-elf/eh1.d index bdf84cc2..f6841dc7 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh1.d +++ b/binutils-2.25/ld/testsuite/ld-elf/eh1.d @@ -23,11 +23,11 @@ Contents of the .eh_frame section: DW_CFA_nop DW_CFA_nop -0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078..0+400078 - DW_CFA_advance_loc: 0 to 0+400078 +0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078\.\.0+400090 + DW_CFA_advance_loc: 8 to 0+400080 DW_CFA_def_cfa_offset: 16 DW_CFA_offset: r6 \(rbp\) at cfa-16 - DW_CFA_advance_loc: 0 to 0+400078 + DW_CFA_advance_loc: 8 to 0+400088 DW_CFA_def_cfa_register: r6 \(rbp\) 0+0038 ZERO terminator diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh1.s b/binutils-2.25/ld/testsuite/ld-elf/eh1.s index a6052096..73d715f3 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh1.s +++ b/binutils-2.25/ld/testsuite/ld-elf/eh1.s @@ -3,8 +3,11 @@ .type _start, %function _start: .LFB2: + .space 8 .LCFI0: + .space 8 .LCFI1: + .space 8 .LFE2: .size _start, .-_start .section .eh_frame,"a",%progbits diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh2.d b/binutils-2.25/ld/testsuite/ld-elf/eh2.d index 65ad4480..cb75a2da 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh2.d +++ b/binutils-2.25/ld/testsuite/ld-elf/eh2.d @@ -23,11 +23,11 @@ Contents of the .eh_frame section: DW_CFA_nop DW_CFA_nop -0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078..0+400078 - DW_CFA_advance_loc: 0 to 0+400078 +0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078\.\.0+400090 + DW_CFA_advance_loc: 8 to 0+400080 DW_CFA_def_cfa_offset: 16 DW_CFA_offset: r6 \(rbp\) at cfa-16 - DW_CFA_advance_loc: 0 to 0+400078 + DW_CFA_advance_loc: 8 to 0+400088 DW_CFA_def_cfa_register: r6 \(rbp\) 0+0038 ZERO terminator diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh3.d b/binutils-2.25/ld/testsuite/ld-elf/eh3.d index 2d322ddd..6ac584a6 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh3.d +++ b/binutils-2.25/ld/testsuite/ld-elf/eh3.d @@ -23,11 +23,11 @@ Contents of the .eh_frame section: DW_CFA_nop DW_CFA_nop -0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078..0+400078 - DW_CFA_advance_loc: 0 to 0+400078 +0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078\.\.0+400090 + DW_CFA_advance_loc: 8 to 0+400080 DW_CFA_def_cfa_offset: 16 DW_CFA_offset: r6 \(rbp\) at cfa-16 - DW_CFA_advance_loc: 0 to 0+400078 + DW_CFA_advance_loc: 8 to 0+400088 DW_CFA_def_cfa_register: r6 \(rbp\) 0+0038 ZERO terminator diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh3.s b/binutils-2.25/ld/testsuite/ld-elf/eh3.s index 24bd90d2..e293c386 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh3.s +++ b/binutils-2.25/ld/testsuite/ld-elf/eh3.s @@ -3,8 +3,11 @@ .type _start, %function _start: .LFB2: + .space 8 .LCFI0: + .space 8 .LCFI1: + .space 8 .LFE2: .size _start, .-_start .section .eh_frame,"a",%progbits diff --git a/binutils-2.25/ld/testsuite/ld-elf/eh5.d b/binutils-2.25/ld/testsuite/ld-elf/eh5.d index 9fea1177..29dcdf9a 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/eh5.d +++ b/binutils-2.25/ld/testsuite/ld-elf/eh5.d @@ -22,7 +22,7 @@ Contents of the .eh_frame section: #... 0+001[48] 0+0014 0+001[8c] FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop @@ -39,14 +39,14 @@ Contents of the .eh_frame section: 0+004[48] 0+0014 0+001c FDE cie=0+00(2c|30) pc=.* DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop 0+00(5c|60) 0+0014 0+006[04] FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop @@ -67,7 +67,7 @@ Contents of the .eh_frame section: Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef) DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop @@ -80,7 +80,7 @@ Contents of the .eh_frame section: Return address column: .* Augmentation data: (0b|1b) - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 #... 0+00(c4|d0) 0+001[04] 0+001[8c] FDE cie=0+00b[08] pc=.* DW_CFA_nop @@ -99,7 +99,7 @@ Contents of the .eh_frame section: 0+0(0f|10)0 0+0014 0+001c FDE cie=0+00[de]8 pc=.* DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop @@ -125,28 +125,28 @@ Contents of the .eh_frame section: Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef) DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop 0+01(58|70) 0+0014 0+01(5c|74) FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop #... 0+01(70|88) 0+0014 0+0(01c|148|15c) FDE cie=0+0(02c|030|170) pc=.* DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop 0+01(88|a0) 0+0014 0+01(8c|a4) FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop @@ -155,7 +155,7 @@ Contents of the .eh_frame section: Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef) DW_CFA_advance_loc: 4 to .* - DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16 + DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-missing.d b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-missing.d new file mode 100644 index 00000000..5c2090fe --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-missing.d @@ -0,0 +1,4 @@ +#source: ehdr_start-strongref.s +#ld: -e _start -T ehdr_start-missing.t +#error: .*: undefined reference to `__ehdr_start' +#target: *-*-linux* *-*-gnu* *-*-nacl* diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-missing.t b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-missing.t new file mode 100644 index 00000000..a4daf066 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-missing.t @@ -0,0 +1,8 @@ +SECTIONS +{ + . = 0x10000000; + .text : { *(.text) } + + . = 0x20000000; + .rodata : { *(.rodata) } +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-shared.d b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-shared.d new file mode 100644 index 00000000..c17516a1 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-shared.d @@ -0,0 +1,9 @@ +#source: ehdr_start.s +#ld: -e _start -shared +#nm: -n +#target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: cris*-*-* frv-*-* + +#... +[0-9a-f]*000 [Adrt] __ehdr_start +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-strongref.s b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-strongref.s new file mode 100644 index 00000000..39375070 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-strongref.s @@ -0,0 +1,9 @@ + .text + .globl _start +_start: + .space 16 + + .section .rodata,"a" + .globl foo +foo: + .dc.a __ehdr_start diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-userdef.d b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-userdef.d new file mode 100644 index 00000000..b58ae3fa --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-userdef.d @@ -0,0 +1,11 @@ +#source: ehdr_start-strongref.s +#ld: -e _start -T ehdr_start-userdef.t +#readelf: -Ws +#target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: frv-*-* + +#... +Symbol table '\.symtab' contains [0-9]+ entries: +#... + *[0-9]+: 0*12345678 +0 +NOTYPE +GLOBAL +DEFAULT +ABS +__ehdr_start +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-userdef.t b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-userdef.t new file mode 100644 index 00000000..6ef1de74 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-userdef.t @@ -0,0 +1,10 @@ +SECTIONS +{ + . = 0x10000000; + .text : { *(.text) } + + __ehdr_start = 0x12345678; + + . = 0x20000000; + .rodata : { *(.rodata) } +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-weak.d b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-weak.d new file mode 100644 index 00000000..24ae34cd --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start-weak.d @@ -0,0 +1,9 @@ +#source: ehdr_start.s +#ld: -e _start -T ehdr_start-missing.t +#nm: -n +#target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: frv-*-* + +#... +\s+[wU] __ehdr_start +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start.d b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start.d index 52e5b548..d538b66d 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/ehdr_start.d +++ b/binutils-2.25/ld/testsuite/ld-elf/ehdr_start.d @@ -2,6 +2,7 @@ #ld: -e _start #nm: -n #target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: frv-*-* #... [0-9a-f]*000 [Adrt] __ehdr_start diff --git a/binutils-2.25/ld/testsuite/ld-elf/elf.exp b/binutils-2.25/ld/testsuite/ld-elf/elf.exp index 236e15bb..839c9314 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/elf.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/elf.exp @@ -1,6 +1,5 @@ # Expect script for various ELF tests. -# Copyright 2002, 2003, 2005, 2007, 2009, 2010, 2011, 2012 -# Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -78,13 +77,12 @@ if { ![istarget hppa64*-hpux*] } { } } -# Run a test to check linking a shared library with a broken linker -# script that accidentally marks dynamic sections as notes. The -# resulting executable is not expected to work, but the linker -# should not seg-fault whilst creating the binary. -# -# Only run the test on targets thats support creating shared libraries. +# Only run these tests on targets thats support creating shared libraries. if { [check_shared_lib_support] } then { + # Run a test to check linking a shared library with a broken linker + # script that accidentally marks dynamic sections as notes. The + # resulting executable is not expected to work, but the linker + # should not seg-fault whilst creating the binary. setup_xfail "tic6x-*-*" run_ld_link_tests { {"Build shared library for next test" @@ -94,6 +92,21 @@ if { [check_shared_lib_support] } then { { { ld "note-3.l" } } "a.out" } } + setup_xfail "tic6x-*-*" + run_ld_link_tests { + {"Build pr17068.so" + "-shared" "" "" + {pr17068d.s} {} "pr17068.so"} + {"Build pr17068a.a" + "" "" "" + {pr17068a.s pr17068c.s pr17068ez.s} {} "pr17068a.a"} + {"Build pr17068b.a" + "" "" "" + {pr17068b.s pr17068e.s} {} "pr17068b.a"} + {"pr17068 link --as-needed lib in group" + "--as-needed" "--start-group tmpdir/pr17068a.a tmpdir/pr17068.so tmpdir/pr17068b.a --end-group" "" + {start.s pr17068.s} {} "pr17068"} + } } set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] diff --git a/binutils-2.25/ld/testsuite/ld-elf/exclude.exp b/binutils-2.25/ld/testsuite/ld-elf/exclude.exp index 28a34ab5..db5b7672 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/exclude.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/exclude.exp @@ -1,5 +1,5 @@ # Expect script for --exclude-libs tests -# Copyright 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/export-class.exp b/binutils-2.25/ld/testsuite/ld-elf/export-class.exp index 38c635c9..cc43ef02 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/export-class.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/export-class.exp @@ -1,6 +1,6 @@ # Expect script for symbol export classes. # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/frame.exp b/binutils-2.25/ld/testsuite/ld-elf/frame.exp index b9307d4f..0f34d72a 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/frame.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/frame.exp @@ -1,5 +1,5 @@ # Expect script for frame section tests -# Copyright 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/group.ld b/binutils-2.25/ld/testsuite/ld-elf/group.ld index 123ab26d..f8e50c37 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/group.ld +++ b/binutils-2.25/ld/testsuite/ld-elf/group.ld @@ -2,5 +2,5 @@ SECTIONS { . = 0x1000; .text : { *(.text) *(.rodata.brlt) } - /DISCARD/ : { *(.dropme) *(.reginfo) } + /DISCARD/ : { *(.dropme) *(.reginfo) *(.MIPS.abiflags) } } diff --git a/binutils-2.25/ld/testsuite/ld-elf/group1.d b/binutils-2.25/ld/testsuite/ld-elf/group1.d index 6ee74cb4..ff675352 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/group1.d +++ b/binutils-2.25/ld/testsuite/ld-elf/group1.d @@ -2,7 +2,7 @@ #source: group1b.s #ld: -T group.ld #readelf: -s -#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* # generic linker targets don't comply with all symbol merging rules Symbol table '.symtab' contains .* entries: diff --git a/binutils-2.25/ld/testsuite/ld-elf/group3b.d b/binutils-2.25/ld/testsuite/ld-elf/group3b.d index 1b8a2a2d..5182f3df 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/group3b.d +++ b/binutils-2.25/ld/testsuite/ld-elf/group3b.d @@ -2,7 +2,7 @@ #source: group3a.s #ld: -T group.ld #readelf: -s -#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* # generic linker targets don't comply with all symbol merging rules Symbol table '.symtab' contains .* entries: diff --git a/binutils-2.25/ld/testsuite/ld-elf/group8a.d b/binutils-2.25/ld/testsuite/ld-elf/group8a.d index bad41230..f645256b 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/group8a.d +++ b/binutils-2.25/ld/testsuite/ld-elf/group8a.d @@ -1,7 +1,7 @@ #source: group8.s #ld: -r --gc-sections --entry foo #readelf: -g --wide -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* #xfail: cr16-*-* crx-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/group8b.d b/binutils-2.25/ld/testsuite/ld-elf/group8b.d index fb371986..2ce6b1aa 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/group8b.d +++ b/binutils-2.25/ld/testsuite/ld-elf/group8b.d @@ -1,7 +1,7 @@ #source: group8.s #ld: -r --gc-sections --entry bar #readelf: -g --wide -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* #xfail: cr16-*-* crx-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/group9a.d b/binutils-2.25/ld/testsuite/ld-elf/group9a.d index fd04c480..62215a5c 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/group9a.d +++ b/binutils-2.25/ld/testsuite/ld-elf/group9a.d @@ -1,7 +1,7 @@ #source: group9.s #ld: -r --gc-sections --entry foo #readelf: -g --wide -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* #xfail: cr16-*-* crx-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/group9b.d b/binutils-2.25/ld/testsuite/ld-elf/group9b.d index 3f19fd6e..c4600d8a 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/group9b.d +++ b/binutils-2.25/ld/testsuite/ld-elf/group9b.d @@ -1,7 +1,7 @@ #source: group9.s #ld: -r --gc-sections --entry bar #readelf: -g --wide -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* #xfail: cr16-*-* crx-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/indirect.exp b/binutils-2.25/ld/testsuite/ld-elf/indirect.exp index d5d3abc5..15ab9296 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/indirect.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/indirect.exp @@ -1,5 +1,5 @@ # Expect script for various indirect symbol tests. -# Copyright 2012 Free Software Foundation, Inc. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/binutils-2.25/ld/testsuite/ld-elf/linkinfo1.s b/binutils-2.25/ld/testsuite/ld-elf/linkinfo1.s new file mode 100644 index 00000000..dadda31c --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/linkinfo1.s @@ -0,0 +1,2 @@ + .text + call foo@PLT diff --git a/binutils-2.25/ld/testsuite/ld-elf/linkinfo1a.d b/binutils-2.25/ld/testsuite/ld-elf/linkinfo1a.d new file mode 100644 index 00000000..8c6fb71c --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/linkinfo1a.d @@ -0,0 +1,8 @@ +#source: linkinfo1.s +#ld: -shared +#readelf: -SW +#target: x86_64-* i?86-* + +#... + \[[ 0-9]+\] \.rel[a]?\.plt[ \t]+REL[A]?[ \t][ \t0-9a-f]+AI[ \t0-9a-f]+ +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/linkinfo1b.d b/binutils-2.25/ld/testsuite/ld-elf/linkinfo1b.d new file mode 100644 index 00000000..cc3aaed1 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/linkinfo1b.d @@ -0,0 +1,9 @@ +#source: linkinfo1.s +#ld: -shared +#objcopy_linked_file: --strip-debug +#readelf: -SW +#target: x86_64-* i?86-* + +#... + \[[ 0-9]+\] \.rel[a]?\.plt[ \t]+REL[A]?[ \t][ \t0-9a-f]+AI[ \t0-9a-f]+ +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/linkonce2.d b/binutils-2.25/ld/testsuite/ld-elf/linkonce2.d index 0cbb3ad6..edc135fa 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/linkonce2.d +++ b/binutils-2.25/ld/testsuite/ld-elf/linkonce2.d @@ -2,7 +2,7 @@ #source: linkonce1b.s #ld: -emit-relocs #objdump: -r -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* # generic elf targets don't emit relocs .*: file format .* diff --git a/binutils-2.25/ld/testsuite/ld-elf/merge.d b/binutils-2.25/ld/testsuite/ld-elf/merge.d index c50de103..450ee07f 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/merge.d +++ b/binutils-2.25/ld/testsuite/ld-elf/merge.d @@ -4,7 +4,7 @@ #xfail: "arc-*-*" "avr-*-*" "bfin-*-*" "cr16-*-*" "cris*-*-*" "crx-*-*" "d10v-*-*" "d30v-*-*" #xfail: "dlx-*-*" "fr30-*-*" "frv-*-*" "hppa*64*-*-*" "h8300-*-*" "score-*-*" #xfail: "i370-*-*" "i860-*-*" "i960-*-*" "ip2k-*-*" "iq2000-*-*" "lm32-*-*" -#xfail: "mcore-*-*" "mn102*-*-*" "mips*-*-*" "ms1-*-*" "mep-*-*" +#xfail: "mcore-*-*" "mn102*-*-*" "ms1-*-*" "mep-*-*" #xfail: "or32-*-*" "pj-*-*" "sparc*-*-*" "tic6x-*-*" "vax-*-*" "xstormy16-*-*" #xfail: "xtensa*-*-*" "metag-*-*" diff --git a/binutils-2.25/ld/testsuite/ld-elf/merge2.d b/binutils-2.25/ld/testsuite/ld-elf/merge2.d index 47706218..f7a18d66 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/merge2.d +++ b/binutils-2.25/ld/testsuite/ld-elf/merge2.d @@ -2,7 +2,7 @@ #ld: -T merge.ld #objdump: -s #xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "hppa64-*-*" -#xfail: "i960-*-*" "ip2k-*-*" "or32-*-*" "pj-*-*" +#xfail: "i960-*-*" "ip2k-*-*" "pj-*-*" .*: file format .*elf.* diff --git a/binutils-2.25/ld/testsuite/ld-elf/needed2.ver b/binutils-2.25/ld/testsuite/ld-elf/needed2.ver new file mode 100644 index 00000000..a68b3d92 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/needed2.ver @@ -0,0 +1,4 @@ +BLAFOO { + global: pam_end; + local: *; +}; diff --git a/binutils-2.25/ld/testsuite/ld-elf/needed2a.c b/binutils-2.25/ld/testsuite/ld-elf/needed2a.c new file mode 100644 index 00000000..538cb22c --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/needed2a.c @@ -0,0 +1,5 @@ +extern void pam_end (void); +void dumpme (void) +{ + pam_end (); +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/needed2b.c b/binutils-2.25/ld/testsuite/ld-elf/needed2b.c new file mode 100644 index 00000000..50c25882 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/needed2b.c @@ -0,0 +1,2 @@ +extern void pam_end (void); +void pam_end (void) {} diff --git a/binutils-2.25/ld/testsuite/ld-elf/needed2c.c b/binutils-2.25/ld/testsuite/ld-elf/needed2c.c new file mode 100644 index 00000000..e43b0d55 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/needed2c.c @@ -0,0 +1,6 @@ +extern void dumpme (void); +int main (void) +{ + dumpme(); + return 0; +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/needed3.c b/binutils-2.25/ld/testsuite/ld-elf/needed3.c new file mode 100644 index 00000000..cbb9d564 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/needed3.c @@ -0,0 +1,8 @@ +extern void foo (void); + +int +main () +{ + foo (); + return 0; +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/orphan-region.d b/binutils-2.25/ld/testsuite/ld-elf/orphan-region.d index bf653567..481d8227 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/orphan-region.d +++ b/binutils-2.25/ld/testsuite/ld-elf/orphan-region.d @@ -2,7 +2,7 @@ #ld: -T orphan-region.ld -N -z stack-size=0 #readelf: -S -l --wide #xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-* -#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-* +#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-* #xfail: spu-*-* hppa*64*-*-* *-*-nacl* # if not using elf32.em, you don't get fancy orphan handling # spu twiddles LOAD range, hppa64 adds PHDR, nacl splits to two segments diff --git a/binutils-2.25/ld/testsuite/ld-elf/orphan-region.ld b/binutils-2.25/ld/testsuite/ld-elf/orphan-region.ld index b7dfdba2..2abf8bcb 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/orphan-region.ld +++ b/binutils-2.25/ld/testsuite/ld-elf/orphan-region.ld @@ -7,5 +7,5 @@ SECTIONS { .text : ALIGN (4) { *(.text) } > region .rodata : ALIGN (4) { *(.rodata) } > region - /DISCARD/ : { *(.reginfo) *(.trampolines) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) } } diff --git a/binutils-2.25/ld/testsuite/ld-elf/orphan.d b/binutils-2.25/ld/testsuite/ld-elf/orphan.d index 7955c8b6..630e5960 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/orphan.d +++ b/binutils-2.25/ld/testsuite/ld-elf/orphan.d @@ -2,7 +2,7 @@ #ld: -T orphan.ld #readelf: -S --wide #xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-* -#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-* +#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-* # if not using elf32.em, you don't get fancy orphan handling #... diff --git a/binutils-2.25/ld/testsuite/ld-elf/orphan.ld b/binutils-2.25/ld/testsuite/ld-elf/orphan.ld index d23222b4..44eb7eb2 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/orphan.ld +++ b/binutils-2.25/ld/testsuite/ld-elf/orphan.ld @@ -4,5 +4,5 @@ SECTIONS .data : { *(.data) } .bss : { *(.bss) *(COMMON) } .note : { *(.note) } - /DISCARD/ : { *(.reginfo) *(.trampolines) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) } } diff --git a/binutils-2.25/ld/testsuite/ld-elf/orphan3.d b/binutils-2.25/ld/testsuite/ld-elf/orphan3.d index ea600d32..dbaaa437 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/orphan3.d +++ b/binutils-2.25/ld/testsuite/ld-elf/orphan3.d @@ -8,7 +8,7 @@ #readelf: -S --wide #xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf" #xfail: "i860-*-*" "i960-*-*" "iq2000-*-*" "mn10200-*-*" "msp430-*-*" "mt-*-*" -#xfail: "or32-*-*" "pj-*-*" +#xfail: "pj-*-*" #xfail: "xstormy16-*-*" #... diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr12851.d b/binutils-2.25/ld/testsuite/ld-elf/pr12851.d index fb61c5ab..8aa48e94 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/pr12851.d +++ b/binutils-2.25/ld/testsuite/ld-elf/pr12851.d @@ -2,7 +2,7 @@ #source: start.s #ld: --gc-sections #readelf: -s --wide -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr12975.d b/binutils-2.25/ld/testsuite/ld-elf/pr12975.d index b361cc2f..11ace1fc 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/pr12975.d +++ b/binutils-2.25/ld/testsuite/ld-elf/pr12975.d @@ -1,7 +1,7 @@ #ld: --gc-sections -shared -version-script pr12975.t #readelf: -s --wide #target: *-*-linux* *-*-gnu* -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr13177.d b/binutils-2.25/ld/testsuite/ld-elf/pr13177.d index e56e8652..a009988a 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/pr13177.d +++ b/binutils-2.25/ld/testsuite/ld-elf/pr13177.d @@ -2,7 +2,7 @@ #ld: --gc-sections -shared #readelf: -s -D --wide #target: *-*-linux* *-*-gnu* -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr13195.d b/binutils-2.25/ld/testsuite/ld-elf/pr13195.d index 796102b9..6b39f2d8 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/pr13195.d +++ b/binutils-2.25/ld/testsuite/ld-elf/pr13195.d @@ -1,7 +1,7 @@ #ld: --gc-sections -shared -version-script pr13195.t #readelf: -s --wide -D #target: *-*-linux* *-*-gnu* -#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-* # generic linker targets don't support --gc-sections, nor do a bunch of others diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr16322.d b/binutils-2.25/ld/testsuite/ld-elf/pr16322.d new file mode 100644 index 00000000..40a7975c --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr16322.d @@ -0,0 +1,7 @@ +#ld: -shared -z relro +#readelf: -l --wide +#target: *-*-linux-gnu *-*-gnu* *-*-nacl* + +#... + GNU_RELRO .* +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr16322.s b/binutils-2.25/ld/testsuite/ld-elf/pr16322.s new file mode 100644 index 00000000..c95817ae --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr16322.s @@ -0,0 +1,6 @@ + .globl p1 + .section .data.rel.ro,"aw",%progbits + .p2align 5 + .type p1, %object +p1: + .dc.a f1 diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr16498a.d b/binutils-2.25/ld/testsuite/ld-elf/pr16498a.d new file mode 100644 index 00000000..436bf971 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr16498a.d @@ -0,0 +1,9 @@ +#ld: -shared -T pr16498a.t +#readelf: -l --wide +#target: *-*-linux* *-*-gnu* *-*-nacl* + +#... + TLS .* +#... +[ ]+[0-9]+[ ]+.tdata .tbss[ ]* +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr16498a.s b/binutils-2.25/ld/testsuite/ld-elf/pr16498a.s new file mode 100644 index 00000000..be503a28 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr16498a.s @@ -0,0 +1,23 @@ + .globl data + .data + .p2align 5 + .type data, %object + .size data, 120 +data: + .long 1 + .zero 116 + .globl foo + .section .tbss,"awT",%nobits + .p2align 2 + .type foo, %object + .size foo, 4 +foo: + .zero 4 + .globl bar + .section .tdata,"awT",%progbits + .p2align 4 + .type bar, %object + .size bar, 80 +bar: + .long 1 + .zero 76 diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr16498a.t b/binutils-2.25/ld/testsuite/ld-elf/pr16498a.t new file mode 100644 index 00000000..928724fa --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr16498a.t @@ -0,0 +1,6 @@ +SECTIONS +{ + .tdata : { *(.tdata) } + .data : { *(.data) + } +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr16498b.d b/binutils-2.25/ld/testsuite/ld-elf/pr16498b.d new file mode 100644 index 00000000..c70c2393 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr16498b.d @@ -0,0 +1,10 @@ +#source: pr16498a.s +#ld: -shared -T pr16498b.t +#readelf: -l --wide +#target: *-*-linux* *-*-gnu* *-*-nacl* + +#... + TLS .* +#... +[ ]+[0-9]+[ ]+tls_data_init .tbss[ ]* +#pass diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr16498b.t b/binutils-2.25/ld/testsuite/ld-elf/pr16498b.t new file mode 100644 index 00000000..b88f9b8e --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr16498b.t @@ -0,0 +1,6 @@ +SECTIONS +{ + tls_data_init : { *(.tdata) } + .data : { *(.data) + } +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr17068.s b/binutils-2.25/ld/testsuite/ld-elf/pr17068.s new file mode 100644 index 00000000..9675ab4a --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr17068.s @@ -0,0 +1,2 @@ + .data + .dc.a a diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr17068a.s b/binutils-2.25/ld/testsuite/ld-elf/pr17068a.s new file mode 100644 index 00000000..552697c9 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr17068a.s @@ -0,0 +1,4 @@ + .data + .globl a +a: + .dc.a b diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr17068b.s b/binutils-2.25/ld/testsuite/ld-elf/pr17068b.s new file mode 100644 index 00000000..aa536f20 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr17068b.s @@ -0,0 +1,4 @@ + .data + .globl b +b: + .dc.a c diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr17068c.s b/binutils-2.25/ld/testsuite/ld-elf/pr17068c.s new file mode 100644 index 00000000..1d78f6d5 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr17068c.s @@ -0,0 +1,4 @@ + .data + .globl c +c: + .dc.a d diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr17068d.s b/binutils-2.25/ld/testsuite/ld-elf/pr17068d.s new file mode 100644 index 00000000..6165128a --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr17068d.s @@ -0,0 +1,6 @@ + .data + .globl d + .type d,%object +d: + .dc.a e + .size d,.-d diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr17068e.s b/binutils-2.25/ld/testsuite/ld-elf/pr17068e.s new file mode 100644 index 00000000..095eb89e --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr17068e.s @@ -0,0 +1,3 @@ + .data + .globl e +e: diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr17068ez.s b/binutils-2.25/ld/testsuite/ld-elf/pr17068ez.s new file mode 100644 index 00000000..70e040d4 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr17068ez.s @@ -0,0 +1,4 @@ + .data + .globl e +e: + .dc.a z diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr2404.out b/binutils-2.25/ld/testsuite/ld-elf/pr2404.out new file mode 100644 index 00000000..d1aa5fe6 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr2404.out @@ -0,0 +1,4 @@ +times: -1 +times: 20 +time: 0 +time: 10 diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr2404a.c b/binutils-2.25/ld/testsuite/ld-elf/pr2404a.c new file mode 100644 index 00000000..4b2b5a94 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr2404a.c @@ -0,0 +1,10 @@ +#include <time.h> +#include <sys/times.h> + +int +bar (void) +{ + struct tms buf; + clock_t ticks = times (&buf); + return ticks == 0 && time (NULL) == 0; +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr2404b.c b/binutils-2.25/ld/testsuite/ld-elf/pr2404b.c new file mode 100644 index 00000000..5f0f7b4c --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/pr2404b.c @@ -0,0 +1,21 @@ +#include <stdio.h> + +extern int bar (void); + +int times = -1; +int time; + +int +main () +{ + printf ("times: %d\n", times); + times = 20; + printf ("times: %d\n", times); + + printf ("time: %d\n", time); + time = 10; + printf ("time: %d\n", time); + bar (); + + return 0; +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/pr349.d b/binutils-2.25/ld/testsuite/ld-elf/pr349.d index 48e32569..f2a577f1 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/pr349.d +++ b/binutils-2.25/ld/testsuite/ld-elf/pr349.d @@ -3,7 +3,7 @@ #ld: -r #readelf: -S #xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-* -#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-* +#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-* # if not using elf32.em, you don't get fancy section handling #... diff --git a/binutils-2.25/ld/testsuite/ld-elf/provide-hidden.exp b/binutils-2.25/ld/testsuite/ld-elf/provide-hidden.exp index 7246d110..8bf5fdc2 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/provide-hidden.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/provide-hidden.exp @@ -1,6 +1,6 @@ # Expect script for the PROVIDE_HIDDEN linker script command. # -# Copyright 2013 Free Software Foundation, Inc. +# Copyright (C) 2013-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/rdynamic-1.c b/binutils-2.25/ld/testsuite/ld-elf/rdynamic-1.c new file mode 100644 index 00000000..7c9d1ab0 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/rdynamic-1.c @@ -0,0 +1,10 @@ +void +rdynamic () +{ +} + +int +main () +{ + return 0; +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/rdynamic-1.rd b/binutils-2.25/ld/testsuite/ld-elf/rdynamic-1.rd new file mode 100644 index 00000000..dbf36021 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-elf/rdynamic-1.rd @@ -0,0 +1,5 @@ +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +_?rdynamic +#... diff --git a/binutils-2.25/ld/testsuite/ld-elf/sec-to-seg.exp b/binutils-2.25/ld/testsuite/ld-elf/sec-to-seg.exp index c9630551..612dd0c4 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/sec-to-seg.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/sec-to-seg.exp @@ -1,6 +1,6 @@ # Test the assigment of sections to segments. # -# Copyright 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2008-2014 Free Software Foundation, Inc. # Contributed by Red Hat. # # This file is part of the GNU Binutils. diff --git a/binutils-2.25/ld/testsuite/ld-elf/sec64k.exp b/binutils-2.25/ld/testsuite/ld-elf/sec64k.exp index 7c9f2929..68216921 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/sec64k.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/sec64k.exp @@ -1,6 +1,5 @@ # Expect script for tests for >64k sections -# Copyright 2002, 2003, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -35,7 +34,7 @@ if { [istarget "arc-*-*"] || [istarget "dlx-*-*"] || [istarget "i960-*-*"] || [istarget "msp430*-*-*"] - || [istarget "or32-*-*"] + || [istarget "or1k*-*-*"] || [istarget "pj*-*-*"] || [istarget "m32r-*-*"] } { return diff --git a/binutils-2.25/ld/testsuite/ld-elf/shared.exp b/binutils-2.25/ld/testsuite/ld-elf/shared.exp index 56c724f4..b55856a2 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/shared.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/shared.exp @@ -1,6 +1,5 @@ # Expect script for various ELF tests. -# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 -# Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -38,6 +37,11 @@ if { [which $CC] == 0 } { return } +# Add -ldl to extralibs if needed +if { ![istarget *-*-freebsd*]} { + set extralibs "-ldl" +} + set build_tests { {"Build libfoo.so" "-shared" "-fPIC" @@ -206,6 +210,42 @@ set build_tests { {"Build librel.so" "-shared" "-fPIC" {rel.c} {} "librel.so"} + {"Build libneeded2a.so" + "-shared" "-fPIC" + {needed2a.c} {} "libneeded2a.so"} + {"Build libneeded2b.so" + "-shared -Wl,--version-script,needed2.ver" "-fPIC" + {needed2b.c} {} "libneeded2b.so"} + {"Build libneeded2c.o" + "-r -nostdlib" "" + {needed2c.c} {} "libneeded2c.o"} + {"Build needed2" + "tmpdir/libneeded2c.o -Wl,--as-needed tmpdir/libneeded2a.so tmpdir/libneeded2b.so" "" + {dummy.c} {} "needed2"} + {"Build libneeded3a.so" + "-shared -Wl,--no-add-needed" "-fPIC" + {needed1a.c} {} "libneeded3a.so"} + {"Build libneeded3b.so" + "-shared -Wl,--no-as-needed,--add-needed -Ltmpdir -lneeded1b" "-fPIC" + {dummy.c} {} "libneeded3b.so"} + {"Build needed3.o" + "-r -nostdlib" "" + {needed3.c} {} "libneeded3.so"} + {"Build needed3" + "tmpdir/needed3.o -Wl,--as-needed -Ltmpdir -lneeded3a -lneeded3b -lneeded1b" "" + {dummy.c} {} "needed3"} + {"Build libpr2404a.so" + "-shared" "-fPIC" + {pr2404a.c} {} "libpr2404a.so"} + {"Build libpr2404b.a" + "" "" + {pr2404b.c} {} "libpr2404b.a"} + {"Build rdynamic-1" + "-rdynamic -Wl,--gc-sections" "-ffunction-sections" + {rdynamic-1.c} {{readelf {-s} rdynamic-1.rd}} "rdynamic-1"} + {"Build dynamic-1" + "-Wl,--dynamic-list,dynamic-1.syms -Wl,--gc-sections" "-ffunction-sections" + {dynamic-1.c} {{readelf {-s} dynamic-1.rd}} "dynamic-1"} } run_cc_link_tests $build_tests @@ -252,10 +292,10 @@ set run_tests { "tmpdir/libbarhfoov.so tmpdir/libfoov.so" "" {main.c} "hidden" "hidden.out"} {"Run dl1a with --dynamic-list=dl1.list and dlopen on libdl1.so" - "--dynamic-list=dl1.list -ldl" "" + "--dynamic-list=dl1.list $extralibs" "" {dl1main.c} "dl1a" "dl1.out"} {"Run dl1b with --dynamic-list-data and dlopen on libdl1.so" - "--dynamic-list-data -ldl" "" + "--dynamic-list-data $extralibs" "" {dl1main.c} "dl1b" "dl1.out"} {"Run with libdl2a.so" "tmpdir/libdl2a.so" "" @@ -285,37 +325,37 @@ set run_tests { "tmpdir/libdl4f.so" "" {dl4main.c} "dl4f" "dl4a.out"} {"Run dl6a1 with --dynamic-list-data and dlopen on libdl6a.so" - "--dynamic-list-data -ldl" "" + "--dynamic-list-data $extralibs" "" {dl6amain.c} "dl6a1" "dl6a.out"} {"Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so" - "-Bsymbolic-functions -ldl" "" + "-Bsymbolic-functions $extralibs" "" {dl6amain.c} "dl6a2" "dl6b.out"} {"Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so" - "-Bsymbolic -ldl" "" + "-Bsymbolic $extralibs" "" {dl6amain.c} "dl6a3" "dl6b.out"} {"Run dl6a4 with -Bsymbolic --dynamic-list-data and dlopen on libdl6a.so" - "-Bsymbolic --dynamic-list-data -ldl" "" + "-Bsymbolic --dynamic-list-data $extralibs" "" {dl6amain.c} "dl6a4" "dl6a.out"} {"Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on libdl6a.so" - "-Bsymbolic-functions --dynamic-list-cpp-new -ldl" "" + "-Bsymbolic-functions --dynamic-list-cpp-new $extralibs" "" {dl6amain.c} "dl6a5" "dl6b.out"} {"Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on libdl6a.so" - "--dynamic-list-cpp-new -Bsymbolic-functions -ldl" "" + "--dynamic-list-cpp-new -Bsymbolic-functions $extralibs" "" {dl6amain.c} "dl6a6" "dl6b.out"} {"Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so" - "--dynamic-list-data -Bsymbolic -ldl" "" + "--dynamic-list-data -Bsymbolic $extralibs" "" {dl6amain.c} "dl6a7" "dl6a.out"} {"Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so" - "--dynamic-list-data -ldl" "" + "--dynamic-list-data $extralibs" "" {dl6bmain.c} "dl6b1" "dl6a.out"} {"Run dl6b2 with dlopen on libdl6b.so" - "-ldl" "" + "$extralibs" "" {dl6bmain.c} "dl6b2" "dl6b.out"} {"Run dl6c1 with --dynamic-list-data and dlopen on libdl6c.so" - "--dynamic-list-data -ldl" "" + "--dynamic-list-data $extralibs" "" {dl6cmain.c} "dl6c1" "dl6b.out"} {"Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so" - "--dynamic-list-data -ldl" "" + "--dynamic-list-data $extralibs" "" {dl6dmain.c} "dl6d1" "dl6b.out"} {"Run with libdata1.so" "tmpdir/libdata1.so" "" @@ -353,6 +393,9 @@ set run_tests { {"Run relmain" "--no-as-needed -rpath=tmpdir -Ltmpdir -lrel" "" {relmain.c} "relmain" "relmain.out"} + {"Run pr2404" + "tmpdir/pr2404b.o tmpdir/libpr2404a.so" "" + {dummy.c} "pr2404" "pr2404.out"} } # NetBSD ELF systems do not currently support the .*_array sections. @@ -360,28 +403,28 @@ run_ld_link_exec_tests [list "*-*-netbsdelf*"] $run_tests # Check --no-add-needed and --no-copy-dt-needed-entries set testname "--no-add-needed" -set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag tmpdir/libneeded1c.o -Wl,--no-add-needed,-rpath-link=tmpdir -Ltmpdir -lneeded1a"] +set exec_output [run_host_cmd "$CC" "tmpdir/libneeded1c.o -Wl,--no-add-needed,-rpath-link=tmpdir -Ltmpdir -lneeded1a"] if { [ regexp "tmpdir/libneeded1b.so: .*: DSO missing" $exec_output ] } { pass $testname } { fail $testname } set testname "--no-copy-dt-needed-entries" -set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag tmpdir/libneeded1c.o -Wl,--no-copy-dt-needed-entries,-rpath-link=tmpdir -Ltmpdir -lneeded1a"] +set exec_output [run_host_cmd "$CC" "tmpdir/libneeded1c.o -Wl,--no-copy-dt-needed-entries,-rpath-link=tmpdir -Ltmpdir -lneeded1a"] if { [ regexp "tmpdir/libneeded1b.so: .*: DSO missing" $exec_output ] } { pass $testname } { fail $testname } set testname "--no-add-needed -shared" -set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag -shared tmpdir/libneeded1pic.o -Wl,--no-add-needed,-z,defs -Ltmpdir -lneeded1a"] +set exec_output [run_host_cmd "$CC" "-shared tmpdir/libneeded1pic.o -Wl,--no-add-needed,-z,defs -Ltmpdir -lneeded1a"] if { [ regexp "undefined reference to `bar'" $exec_output ] } { pass $testname } { fail $testname } set testname "--no-copy-dt-needed-entries -shared" -set exec_output [run_host_cmd "$CC" "$gcc_gas_flag $gcc_ld_flag -shared tmpdir/libneeded1pic.o -Wl,--no-copy-dt-needed-entries,-z,defs -Ltmpdir -lneeded1a"] +set exec_output [run_host_cmd "$CC" "-shared tmpdir/libneeded1pic.o -Wl,--no-copy-dt-needed-entries,-z,defs -Ltmpdir -lneeded1a"] if { [ regexp "undefined reference to `bar'" $exec_output ] } { pass $testname } { @@ -432,3 +475,29 @@ set run_cxx_tests { run_cc_link_tests $build_cxx_tests run_ld_link_exec_tests [] $run_cxx_tests + +if { [istarget *-*-linux*] + || [istarget *-*-nacl*] + || [istarget *-*-gnu*] } { + run_cc_link_tests [list \ + [list \ + "Build libpr2404b.a with PIE" \ + "" \ + "-fPIE" \ + { pr2404b.c } \ + {} \ + "libpr2404b.a" \ + ] \ + ] + run_ld_link_exec_tests [] [list \ + [list \ + "Run pr2404 with PIE" \ + "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \ + "" \ + { dummy.c } \ + "pr2404pie" \ + "pr2404.out" \ + "-fPIE" \ + ] \ + ] +} diff --git a/binutils-2.25/ld/testsuite/ld-elf/tls_common.exp b/binutils-2.25/ld/testsuite/ld-elf/tls_common.exp index fee40316..48a833f2 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/tls_common.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/tls_common.exp @@ -1,5 +1,5 @@ # Expect script for .tls_common tests -# Copyright 2006, 2007, 2010, 2012 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-elf/warn1.d b/binutils-2.25/ld/testsuite/ld-elf/warn1.d index 3ef5032e..b22b64fd 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/warn1.d +++ b/binutils-2.25/ld/testsuite/ld-elf/warn1.d @@ -5,7 +5,7 @@ #warning: ^[^\\n]*\): warning: witty one-liner$ #readelf: -s #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*" -#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "or32-*-*" "pj-*-*" +#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "pj-*-*" # Check that warnings are generated for the .gnu.warning.SYMBOL # construct and that the symbol still appears as expected. diff --git a/binutils-2.25/ld/testsuite/ld-elf/warn2.d b/binutils-2.25/ld/testsuite/ld-elf/warn2.d index 95b7ef49..ee7220e1 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/warn2.d +++ b/binutils-2.25/ld/testsuite/ld-elf/warn2.d @@ -6,7 +6,7 @@ #readelf: -s #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*" #xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-* -#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-* +#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-* # if not using elf32.em, you don't get fancy section handling # Check that warnings are generated for the symbols in .gnu.warning diff --git a/binutils-2.25/ld/testsuite/ld-elf/warn3.d b/binutils-2.25/ld/testsuite/ld-elf/warn3.d index 53dee189..dc245403 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/warn3.d +++ b/binutils-2.25/ld/testsuite/ld-elf/warn3.d @@ -3,7 +3,7 @@ #warning: .*: warning: badsym warning$ #readelf: -s #notarget: hppa64*-hpux* -#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-* +#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-* # generic linker targets don't support .gnu.warning sections. # Check that warnings are generated for the symbols in .gnu.warning diff --git a/binutils-2.25/ld/testsuite/ld-elf/wrap.exp b/binutils-2.25/ld/testsuite/ld-elf/wrap.exp index 70e433d9..3bf05885 100644 --- a/binutils-2.25/ld/testsuite/ld-elf/wrap.exp +++ b/binutils-2.25/ld/testsuite/ld-elf/wrap.exp @@ -1,5 +1,5 @@ # Expect script for wrap ELF tests. -# Copyright 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # |