aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorIain Sandoe <iain@codesourcery.com>2011-12-19 15:42:37 +0000
committerIain Sandoe <iain@codesourcery.com>2011-12-19 15:42:37 +0000
commitab76eeafa578ca7e301e3aa014e4ed643e32ec2e (patch)
tree617c8c1e0b565e6331bc0200dbec3e1eb6149dd1 /gas/testsuite
parent72225e1798fce2f36c4eb021338707ed69517abe (diff)
downloadgdb-ab76eeafa578ca7e301e3aa014e4ed643e32ec2e.zip
gdb-ab76eeafa578ca7e301e3aa014e4ed643e32ec2e.tar.gz
gdb-ab76eeafa578ca7e301e3aa014e4ed643e32ec2e.tar.bz2
bfd:
* mach-o-i386.c (bfd_mach_o_section_type_valid_for_tgt): Define NULL. * mach-o-target.c (bfd_mach_o_backend_data): Initialize bfd_mach_o_section_type_valid_for_tgt * mach-o-x86-64.c (bfd_mach_o_section_type_valid_for_x86_64): New. (bfd_mach_o_section_type_valid_for_tgt): Set to bfd_mach_o_section_type_valid_for_x86_64. * mach-o.c (bfd_mach_o_section_type_name): Reorder and eliminate dup. (bfd_mach_o_section_attribute_name): Reorder. (bfd_mach_o_get_section_type_from_name): If the target has defined a validator for section types, then use it. * mach-o.h (bfd_mach_o_get_section_type_from_name): Alter declaration to include the bfd. gas: * config/obj-macho.c (obj_mach_o_section): Account for target-dependent section types. Improve error handling when wrong section types/attributes are specified. gas/testsuite: * gas/mach-o/err-sections-1.s: New. * gas/mach-o/err-sections-2.s: New. * gas/mach-o/sections-3.d: New. * gas/mach-o/sections-3.s: New.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/mach-o/err-sections-1.s9
-rw-r--r--gas/testsuite/gas/mach-o/err-sections-2.s9
-rw-r--r--gas/testsuite/gas/mach-o/sections-3.d19
-rw-r--r--gas/testsuite/gas/mach-o/sections-3.s7
5 files changed, 51 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index c9efc90..723b8c4 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2011-12-19 Iain Sandoe <idsandoe@googlemail.com>
+
+ * gas/mach-o/err-sections-1.s: New.
+ * gas/mach-o/err-sections-2.s: New.
+ * gas/mach-o/sections-3.d: New.
+ * gas/mach-o/sections-3.s: New.
+
2011-12-15 Iain Sandoe <iains@gcc.gnu.org>
* gas/mach-o/subsect-via-symbols-0.d: New.
diff --git a/gas/testsuite/gas/mach-o/err-sections-1.s b/gas/testsuite/gas/mach-o/err-sections-1.s
new file mode 100644
index 0000000..99447a7
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/err-sections-1.s
@@ -0,0 +1,9 @@
+# { dg-do assemble { target x86_64-*-darwin* } }
+
+ .section __a,__b,symbol_stubs,strip_static_syms,4
+ .section __a,__c,lazy_symbol_pointers,strip_static_syms,4
+ .section __a,__d,non_lazy_symbol_pointers,strip_static_syms,4
+
+# { dg-error "unknown or invalid section type .symbol_stubs." "" { target x86_64-*-darwin* } 3 }
+# { dg-error "unknown or invalid section type .lazy_symbol_pointers." "" { target x86_64-*-darwin* } 4 }
+# { dg-error "unknown or invalid section type .non_lazy_symbol_pointers." "" { target x86_64-*-darwin* } 5 }
diff --git a/gas/testsuite/gas/mach-o/err-sections-2.s b/gas/testsuite/gas/mach-o/err-sections-2.s
new file mode 100644
index 0000000..3343066
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/err-sections-2.s
@@ -0,0 +1,9 @@
+# { dg-do assemble { target x86_64-*-darwin* } }
+
+ .symbol_stub
+ .lazy_symbol_pointer
+ .non_lazy_symbol_pointer
+
+# { dg-error ".symbol_stub is not used for the selected target" "" { target x86_64-*-darwin* } 3 }
+# { dg-error ".lazy_symbol_pointer is not used for the selected target" "" { target x86_64-*-darwin* } 4 }
+# { dg-error ".non_lazy_symbol_pointer is not used for the selected target" "" { target x86_64-*-darwin* } 5 }
diff --git a/gas/testsuite/gas/mach-o/sections-3.d b/gas/testsuite/gas/mach-o/sections-3.d
new file mode 100644
index 0000000..9d1daf4
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/sections-3.d
@@ -0,0 +1,19 @@
+#objdump: -P section
+#not-target: x86_64-*-darwin*
+.*: +file format mach-o.*
+#...
+ Section: __symbol_stub __TEXT.*\(bfdname: .symbol_stub\)
+ addr: (00000000)?00000000 size: (00000000)?00000000 offset: (00000000)?00000000
+ align: 0 nreloc: 0 reloff: (00000000)?00000000
+ flags: 80000008 \(type: symbol_stubs attr: pure_instructions\)
+ first indirect sym: 0 \(0 entries\) stub size: (16|20) reserved3: 0x0
+ Section: __la_symbol_ptr __DATA.*\(bfdname: .lazy_symbol_pointer\)
+ addr: (00000000)?00000000 size: (00000000)?00000000 offset: (00000000)?00000000
+ align: 2 nreloc: 0 reloff: (00000000)?00000000
+ flags: 00000007 \(type: lazy_symbol_pointers attr: -\)
+ first indirect sym: 0 \(0 entries\) reserved2: 0x0 reserved3: 0x0
+ Section: __nl_symbol_ptr __DATA.*\(bfdname: .non_lazy_symbol_pointer\)
+ addr: (00000000)?00000000 size: (00000000)?00000000 offset: (00000000)?00000000
+ align: 2 nreloc: 0 reloff: (00000000)?00000000
+ flags: 00000006 \(type: non_lazy_symbol_pointers attr: -\)
+ first indirect sym: 0 \(0 entries\) reserved2: 0x0 reserved3: 0x0
diff --git a/gas/testsuite/gas/mach-o/sections-3.s b/gas/testsuite/gas/mach-o/sections-3.s
new file mode 100644
index 0000000..17fae52
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/sections-3.s
@@ -0,0 +1,7 @@
+
+ .symbol_stub
+
+ .lazy_symbol_pointer
+
+ .non_lazy_symbol_pointer
+