[PATCH 1/4] Arm/COFF: accept .def outside of CCS mode
Jan Beulich
jbeulich@suse.com
Fri Apr 25 12:59:57 GMT 2025
There's no reason to reject this common COFF directive when it doesn't
have any other meaning.
---
Leaves open what to do in CCS mode, if that's relevant at all for COFF.
--- a/binutils/testsuite/binutils-all/nm.exp
+++ b/binutils/testsuite/binutils-all/nm.exp
@@ -163,7 +163,7 @@ if { [is_elf_format]
|| [istarget wasm32-*-*]
|| [istarget bpf-*-*]} {
set nm_1_src "nm-elf-1.s"
-} elseif {[is_coff_format] && ![istarget arm*-*-*]} {
+} elseif {[is_coff_format]} {
if {[istarget *c4x-*-*] || [istarget *c54x-*-*]} {
set nm_1_src "nm-coff-sdef-1.s"
} else {
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -569,7 +569,7 @@ obj_coff_ident (int ignore ATTRIBUTE_UNU
#define SKIP_WHITESPACES() while (is_whitespace (*input_line_pointer)) \
input_line_pointer++;
-static void
+void
obj_coff_def (int what ATTRIBUTE_UNUSED)
{
if (def_symbol_in_progress != NULL)
--- a/gas/config/obj-coff.h
+++ b/gas/config/obj-coff.h
@@ -330,7 +330,7 @@ extern void pecoff_obj_clear_weak_hook
#endif
extern void obj_coff_section (int);
extern segT obj_coff_add_segment (const char *);
-extern void obj_coff_section (int);
+extern void obj_coff_def (int);
extern segT s_get_segment (symbolS *);
#ifndef tc_coff_symbol_emit_hook
extern void tc_coff_symbol_emit_hook (symbolS *);
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -3434,7 +3434,11 @@ s_ccs_def (int name)
if (codecomposer_syntax)
s_globl (name);
else
+#ifdef OBJ_COFF
+ obj_coff_def (name);
+#else
as_bad (_(".def pseudo-op only available with -mccs flag."));
+#endif
}
/* Directives: Literal pools. */
More information about the Binutils
mailing list