aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-05-17 16:43:02 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-05-17 16:43:02 +0000
commit75ff45898cb591177506dc60164e167fc8c79c59 (patch)
tree4a25a8df9a4b7422ad862803d16b906f50e7508c /ld/testsuite/ld-scripts
parent8e0ed13fa56c0f18e69a559dcace1fc9431874a2 (diff)
downloadgdb-75ff45898cb591177506dc60164e167fc8c79c59.zip
gdb-75ff45898cb591177506dc60164e167fc8c79c59.tar.gz
gdb-75ff45898cb591177506dc60164e167fc8c79c59.tar.bz2
bfd/
2005-05-17 H.J. Lu <hongjiu.lu@intel.com> PR 797 * elf32-i386.c (elf_i386_size_dynamic_sections): Also remove empty sdynbss section. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise. ld/ 2005-05-17 H.J. Lu <hongjiu.lu@intel.com> PR 797 * ldexp.c (exp_fold_tree_1): Renamed from exp_fold_tree and take take a bfd_boolean, mark_used. Ignore assert failure if mark_used is TRUE. (exp_fold_tree) Call exp_fold_tree_1 with mark_used == FALSE. (exp_fold_tree_no_dot): Updated to take a bfd_boolean, mark_used and pass down. (fold_unary): Likewise. (fold_binary): Likewise. (fold_trinary): Likewise. (exp_binop): Add FALSE to call to exp_fold_tree_no_dot. (exp_trinop): Likewise. (exp_unop): Likewise. (exp_nameop): Likewise. (exp_get_vma): Likewise. (exp_get_fill): Likewise. (exp_get_abs_int): Likewise. (fold_name): Likewise. Set SEC_KEEP in output section flags. (exp_mark_used_section): New. * ldexp.h (exp_mark_used_section): New. * ldlang.c (lang_output_section_statement_lookup_1): Set the ignored field to FALSE. (lang_mark_used_section_1): New. (lang_mark_used_section): Call lang_mark_used_section_1. (strip_excluded_output_sections): Call lang_mark_used_section and check for unused sections. (lang_size_sections_1): Skip an output section if it should be ignored. (lang_do_assignments_1): Likewise. (lang_process): Don't call lang_mark_used_section here. * ldlang.h (lang_output_section_statement_type): Change all_input_readonly to bitfield. Add ignored. ld/testsuite/ 2005-05-17 H.J. Lu <hongjiu.lu@intel.com> PR 797 * empty-aligned.d: New file. * empty-aligned.exp: Likewise. * empty-aligned.s: Likewise. * empty-aligned.t: Likewise.
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/empty-aligned.d12
-rw-r--r--ld/testsuite/ld-scripts/empty-aligned.exp26
-rw-r--r--ld/testsuite/ld-scripts/empty-aligned.s4
-rw-r--r--ld/testsuite/ld-scripts/empty-aligned.t16
4 files changed, 58 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/empty-aligned.d b/ld/testsuite/ld-scripts/empty-aligned.d
new file mode 100644
index 0000000..493a40c
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-aligned.d
@@ -0,0 +1,12 @@
+#source: empty-aligned.s
+#ld: -T empty-aligned.t
+#readelf: -l --wide
+
+#...
+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.*\.data.*
diff --git a/ld/testsuite/ld-scripts/empty-aligned.exp b/ld/testsuite/ld-scripts/empty-aligned.exp
new file mode 100644
index 0000000..17820ed
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-aligned.exp
@@ -0,0 +1,26 @@
+# Make sure empty aligned sections do not change output layout.
+# Copyright 2005
+# 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.
+
+# PHDRS is only meaningful for ELF.
+if ![is_elf_format] {
+ return
+}
+
+set testname "empty-aligned"
+
+run_dump_test empty-aligned
diff --git a/ld/testsuite/ld-scripts/empty-aligned.s b/ld/testsuite/ld-scripts/empty-aligned.s
new file mode 100644
index 0000000..f386e9e
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-aligned.s
@@ -0,0 +1,4 @@
+ .text
+ .long 123
+ .data
+ .long 123
diff --git a/ld/testsuite/ld-scripts/empty-aligned.t b/ld/testsuite/ld-scripts/empty-aligned.t
new file mode 100644
index 0000000..d3036be
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-aligned.t
@@ -0,0 +1,16 @@
+SECTIONS
+{
+ .text : { *(.text) }
+ .text2 :
+ {
+ . = ALIGN(4096);
+ *(.text2)
+ }
+ .text3 :
+ {
+ *(.text3)
+ . = ALIGN(4096);
+ }
+ .data : { *(.data) }
+ .bss : { *(.bss) }
+}