summaryrefslogtreecommitdiff
path: root/bfd/mach-o-x86-64.c
diff options
context:
space:
mode:
authoriains <iains>2011-12-19 15:42:34 +0000
committeriains <iains>2011-12-19 15:42:34 +0000
commitb0a36ffa88334fe9e5e009dbcbc42ebc8bd91a4e (patch)
treed51c1666d8fe8c2a10f878a5883d181f856f701d /bfd/mach-o-x86-64.c
parentcf5a60020e18aeb3723713a33bb274f6d7157a08 (diff)
downloadbinutils-redhat-b0a36ffa88334fe9e5e009dbcbc42ebc8bd91a4e.tar.gz
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 'bfd/mach-o-x86-64.c')
-rw-r--r--bfd/mach-o-x86-64.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bfd/mach-o-x86-64.c b/bfd/mach-o-x86-64.c
index c86efb71ac..cc31a1c3d6 100644
--- a/bfd/mach-o-x86-64.c
+++ b/bfd/mach-o-x86-64.c
@@ -281,6 +281,16 @@ bfd_mach_o_x86_64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return NULL;
}
+static bfd_boolean
+bfd_mach_o_section_type_valid_for_x86_64 (unsigned long val)
+{
+ if (val == BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS
+ || val == BFD_MACH_O_S_LAZY_SYMBOL_POINTERS
+ || val == BFD_MACH_O_S_SYMBOL_STUBS)
+ return FALSE;
+ return TRUE;
+}
+
#define bfd_mach_o_swap_reloc_in bfd_mach_o_x86_64_swap_reloc_in
#define bfd_mach_o_swap_reloc_out bfd_mach_o_x86_64_swap_reloc_out
@@ -288,6 +298,7 @@ bfd_mach_o_x86_64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
#define bfd_mach_o_bfd_reloc_name_lookup bfd_mach_o_x86_64_bfd_reloc_name_lookup
#define bfd_mach_o_print_thread NULL
#define bfd_mach_o_tgt_seg_table NULL
+#define bfd_mach_o_section_type_valid_for_tgt bfd_mach_o_section_type_valid_for_x86_64
#define TARGET_NAME mach_o_x86_64_vec
#define TARGET_STRING "mach-o-x86-64"