diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2006-09-27 04:18:16 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2006-09-27 04:18:16 +0000 |
commit | 49c13adb16c432e9d04770f7c6b8348e31bb1df1 (patch) | |
tree | 4169c5e520d6c3228abd35ebf85228ca9cda9375 /ld/testsuite | |
parent | f36b9bcd93570f658ebfe3c6946409eed2533e6d (diff) | |
download | binutils-gdb-49c13adb16c432e9d04770f7c6b8348e31bb1df1.tar.gz |
bfd/
2006-09-26 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3223
PR ld/3267
* elf.c (assign_file_positions_for_non_load_sections): Don't
warn zero size allocated sections.
ld/
2006-09-26 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3223
PR ld/3267
* ld.texinfo: Updated Output Section Discarding.
* ldlang.h (lang_output_section_statement_type): Add
section_relative_symbol.
* ldlang.c (strip_excluded_output_sections): Don't strip a
section with a symbol relative to it.
(lang_size_sections_1): Mark if an output section has a symbol
symbol relative to it.
ld/testsuite/
2006-09-26 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3223
PR ld/3267
* ld-scripts/empty-address-1.d: New file.
* ld-scripts/empty-address-1.s: Likewise.
* ld-scripts/empty-address-1.t: Likewise.
* ld-scripts/empty-address-2.s: Likewise.
* ld-scripts/empty-address-2a.d: Likewise.
* ld-scripts/empty-address-2a.t: Likewise.
* ld-scripts/empty-address-2b.d: Likewise.
* ld-scripts/empty-address-2b.t: Likewise.
* ld-scripts/empty-address-3.s: Likewise.
* ld-scripts/empty-address-3a.d: Likewise.
* ld-scripts/empty-address-3a.t: Likewise.
* ld-scripts/empty-address-3b.d: Likewise.
* ld-scripts/empty-address-3b.t: Likewise.
* ld-scripts/empty-address-3c.d: Likewise.
* ld-scripts/empty-address-3c.t: Likewise.
* ld-scripts/empty-address.exp: Likewise.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 21 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-1.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-1.s | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-1.t | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2.s | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2a.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2a.t | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2b.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-2b.t | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-3.s | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-3a.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-3a.t | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-3b.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-3b.t | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-3c.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address-3c.t | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/empty-address.exp | 25 |
17 files changed, 172 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index fd9f422dd1b..0cf9890e621 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,24 @@ +2006-09-26 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/3223 + PR ld/3267 + * ld-scripts/empty-address-1.d: New file. + * ld-scripts/empty-address-1.s: Likewise. + * ld-scripts/empty-address-1.t: Likewise. + * ld-scripts/empty-address-2.s: Likewise. + * ld-scripts/empty-address-2a.d: Likewise. + * ld-scripts/empty-address-2a.t: Likewise. + * ld-scripts/empty-address-2b.d: Likewise. + * ld-scripts/empty-address-2b.t: Likewise. + * ld-scripts/empty-address-3.s: Likewise. + * ld-scripts/empty-address-3a.d: Likewise. + * ld-scripts/empty-address-3a.t: Likewise. + * ld-scripts/empty-address-3b.d: Likewise. + * ld-scripts/empty-address-3b.t: Likewise. + * ld-scripts/empty-address-3c.d: Likewise. + * ld-scripts/empty-address-3c.t: Likewise. + * ld-scripts/empty-address.exp: Likewise. + 2006-09-21 Andreas Schwab <schwab@suse.de> * ld-m68k/plt1-68020.d: Fix patterns to match also for 64-bit diff --git a/ld/testsuite/ld-scripts/empty-address-1.d b/ld/testsuite/ld-scripts/empty-address-1.d new file mode 100644 index 00000000000..8b13014b5e7 --- /dev/null +++ b/ld/testsuite/ld-scripts/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 D __data_start +#pass diff --git a/ld/testsuite/ld-scripts/empty-address-1.s b/ld/testsuite/ld-scripts/empty-address-1.s new file mode 100644 index 00000000000..c5cc1a596c8 --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-1.s @@ -0,0 +1,5 @@ + .text + .global _start +_start: + .long __data_start + .long __data_end diff --git a/ld/testsuite/ld-scripts/empty-address-1.t b/ld/testsuite/ld-scripts/empty-address-1.t new file mode 100644 index 00000000000..57a8bed2771 --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-1.t @@ -0,0 +1,11 @@ +SECTIONS +{ + .text 0x0000000: { *(.text) } + .data 0x2000000: + { + __data_start = . ; + *(.data) + } + __data_end = .; + /DISCARD/ : { *(.*) } +} diff --git a/ld/testsuite/ld-scripts/empty-address-2.s b/ld/testsuite/ld-scripts/empty-address-2.s new file mode 100644 index 00000000000..79f58eacc34 --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-2.s @@ -0,0 +1,5 @@ + .text + .global _start +_start: + .long __data_end + .p2align 4 diff --git a/ld/testsuite/ld-scripts/empty-address-2a.d b/ld/testsuite/ld-scripts/empty-address-2a.d new file mode 100644 index 00000000000..d831d5ffd1a --- /dev/null +++ b/ld/testsuite/ld-scripts/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 diff --git a/ld/testsuite/ld-scripts/empty-address-2a.t b/ld/testsuite/ld-scripts/empty-address-2a.t new file mode 100644 index 00000000000..6a40ad8b7c4 --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-2a.t @@ -0,0 +1,7 @@ +SECTIONS +{ + .text : { *(.text) } + .data : { *(.data) } + __data_end = .; + /DISCARD/ : { *(.*) } +} diff --git a/ld/testsuite/ld-scripts/empty-address-2b.d b/ld/testsuite/ld-scripts/empty-address-2b.d new file mode 100644 index 00000000000..514fd68e260 --- /dev/null +++ b/ld/testsuite/ld-scripts/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 diff --git a/ld/testsuite/ld-scripts/empty-address-2b.t b/ld/testsuite/ld-scripts/empty-address-2b.t new file mode 100644 index 00000000000..dcf264f4a28 --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-2b.t @@ -0,0 +1,11 @@ +SECTIONS +{ + .text 0x0000000: { *(.text) } + .data : + { + PROVIDE (__data_start = .); + *(.data) + } + __data_end = .; + /DISCARD/ : { *(.*) } +} diff --git a/ld/testsuite/ld-scripts/empty-address-3.s b/ld/testsuite/ld-scripts/empty-address-3.s new file mode 100644 index 00000000000..6b07dd434d5 --- /dev/null +++ b/ld/testsuite/ld-scripts/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 diff --git a/ld/testsuite/ld-scripts/empty-address-3a.d b/ld/testsuite/ld-scripts/empty-address-3a.d new file mode 100644 index 00000000000..bb12c801906 --- /dev/null +++ b/ld/testsuite/ld-scripts/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 diff --git a/ld/testsuite/ld-scripts/empty-address-3a.t b/ld/testsuite/ld-scripts/empty-address-3a.t new file mode 100644 index 00000000000..2807e71f561 --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-3a.t @@ -0,0 +1,10 @@ +SECTIONS +{ + .text 0x00000000: { *(.text) } + .data ALIGN(0x1000) + (. & (0x1000 - 1)): + { + *(.data) + } + __data_end = .; + /DISCARD/ : { *(.*) } +} diff --git a/ld/testsuite/ld-scripts/empty-address-3b.d b/ld/testsuite/ld-scripts/empty-address-3b.d new file mode 100644 index 00000000000..b3e2a4b5ec3 --- /dev/null +++ b/ld/testsuite/ld-scripts/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 diff --git a/ld/testsuite/ld-scripts/empty-address-3b.t b/ld/testsuite/ld-scripts/empty-address-3b.t new file mode 100644 index 00000000000..4f213af519e --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-3b.t @@ -0,0 +1,11 @@ +SECTIONS +{ + .text 0x00000000: { *(.text) } + .data ALIGN(0x1000) + (. & (0x1000 - 1)): + { + PROVIDE (__data_start = .); + *(.data) + } + __data_end = .; + /DISCARD/ : { *(.*) } +} diff --git a/ld/testsuite/ld-scripts/empty-address-3c.d b/ld/testsuite/ld-scripts/empty-address-3c.d new file mode 100644 index 00000000000..41e0afbd061 --- /dev/null +++ b/ld/testsuite/ld-scripts/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 D __data_start +#pass diff --git a/ld/testsuite/ld-scripts/empty-address-3c.t b/ld/testsuite/ld-scripts/empty-address-3c.t new file mode 100644 index 00000000000..6de519881fe --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address-3c.t @@ -0,0 +1,11 @@ +SECTIONS +{ + .text 0x00000000: { *(.text) } + .data ALIGN(0x1000) + (. & (0x1000 - 1)): + { + __data_start = .; + *(.data) + } + __data_end = .; + /DISCARD/ : { *(.*) } +} diff --git a/ld/testsuite/ld-scripts/empty-address.exp b/ld/testsuite/ld-scripts/empty-address.exp new file mode 100644 index 00000000000..556aabae42f --- /dev/null +++ b/ld/testsuite/ld-scripts/empty-address.exp @@ -0,0 +1,25 @@ +# Make sure that "dot" is updated for empty sections if their addresses +# are set. +# Copyright 2006 +# 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 +# the Free Software Foundation; either version 2 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 |