aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/config/obj-coff.c27
-rw-r--r--gas/config/obj-coff.h3
-rw-r--r--gas/config/tc-aarch64.c8
-rw-r--r--gas/config/tc-aarch64.h2
-rw-r--r--gas/config/tc-arm.c26
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/config/tc-i386.h2
-rw-r--r--gas/config/tc-ppc.c7
-rw-r--r--gas/gen-sframe.c4
-rw-r--r--gas/testsuite/gas/all/gas.exp15
-rw-r--r--gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.d21
-rw-r--r--gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.s4
-rw-r--r--gas/testsuite/gas/cfi-sframe/cfi-sframe.exp1
-rw-r--r--gas/testsuite/gas/coff/coff.exp40
-rw-r--r--gas/testsuite/gas/coff/func1.d16
-rw-r--r--gas/testsuite/gas/coff/func1.s22
-rw-r--r--gas/testsuite/gas/coff/func2.d16
-rw-r--r--gas/testsuite/gas/coff/func2.s34
-rw-r--r--gas/testsuite/gas/coff/func3.d16
-rw-r--r--gas/testsuite/gas/coff/func3.s33
-rw-r--r--gas/testsuite/gas/coff/func4.d18
-rw-r--r--gas/testsuite/gas/coff/func4.s41
-rw-r--r--gas/testsuite/gas/coff/tag.d (renamed from gas/testsuite/gas/all/cofftag.d)2
-rw-r--r--gas/testsuite/gas/coff/tag.s (renamed from gas/testsuite/gas/all/cofftag.s)2
-rw-r--r--gas/testsuite/gas/loongarch/div_zero.l4
-rw-r--r--gas/testsuite/gas/loongarch/div_zero.s2
-rw-r--r--gas/testsuite/gas/loongarch/loongarch.exp1
-rw-r--r--gas/testsuite/gas/ppc/future.d35
-rw-r--r--gas/testsuite/gas/ppc/future.s18
29 files changed, 365 insertions, 57 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index eb5784e..2c95ba9 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -569,7 +569,7 @@ obj_coff_ident (int ignore ATTRIBUTE_UNUSED)
#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)
@@ -1187,7 +1187,6 @@ coff_assign_symbol (symbolS *symp ATTRIBUTE_UNUSED)
#endif
}
-symbolS *coff_last_function;
#ifndef OBJ_XCOFF
static symbolS *coff_last_bf;
#endif
@@ -1195,6 +1194,7 @@ static symbolS *coff_last_bf;
void
coff_frob_symbol (symbolS *symp, int *punt)
{
+ static symbolS *last_functionP;
static symbolS *last_tagP;
static stack *block_stack;
static symbolS *set_end;
@@ -1338,30 +1338,26 @@ coff_frob_symbol (symbolS *symp, int *punt)
}
}
- if (coff_last_function == 0 && SF_GET_FUNCTION (symp)
- && S_IS_DEFINED (symp))
+ if (SF_GET_FUNCTION (symp) && S_IS_DEFINED (symp))
{
union internal_auxent *auxp;
- coff_last_function = symp;
if (S_GET_NUMBER_AUXILIARY (symp) < 1)
S_SET_NUMBER_AUXILIARY (symp, 1);
auxp = SYM_AUXENT (symp);
- memset (auxp->x_sym.x_fcnary.x_ary.x_dimen, 0,
- sizeof (auxp->x_sym.x_fcnary.x_ary.x_dimen));
+ memset (&auxp->x_sym.x_fcnary.x_fcn, 0,
+ sizeof (auxp->x_sym.x_fcnary.x_fcn));
}
if (S_GET_STORAGE_CLASS (symp) == C_EFCN
&& S_IS_DEFINED (symp))
{
- if (coff_last_function == 0)
+ if (!last_functionP)
as_fatal (_("C_EFCN symbol for %s out of scope"),
S_GET_NAME (symp));
- SA_SET_SYM_FSIZE (coff_last_function,
+ SA_SET_SYM_FSIZE (last_functionP,
(long) (S_GET_VALUE (symp)
- - S_GET_VALUE (coff_last_function)));
- next_set_end = coff_last_function;
- coff_last_function = 0;
+ - S_GET_VALUE (last_functionP)));
}
}
@@ -1415,6 +1411,13 @@ coff_frob_symbol (symbolS *symp, int *punt)
set_end = next_set_end;
}
+ if (SF_GET_FUNCTION (symp) && S_IS_DEFINED (symp) && !*punt)
+ {
+ if (last_functionP)
+ SA_SET_SYM_ENDNDX (last_functionP, symp);
+ last_functionP = symp;
+ }
+
#ifndef OBJ_XCOFF
if (! *punt
&& S_GET_STORAGE_CLASS (symp) == C_FCN
diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h
index c083ad2..51dfd56 100644
--- a/gas/config/obj-coff.h
+++ b/gas/config/obj-coff.h
@@ -242,7 +242,6 @@
extern int text_lineno_number;
extern int coff_line_base;
extern int coff_n_line_nos;
-extern symbolS *coff_last_function;
#define obj_emit_lineno(WHERE, LINE, FILE_START) abort ()
#define obj_app_file(name) c_dot_file_symbol (name)
@@ -330,7 +329,7 @@ extern void pecoff_obj_clear_weak_hook (symbolS *);
#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 *);
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index e071ad1..acb5604 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -9121,7 +9121,7 @@ aarch64_sframe_cfa_ra_offset (void)
return (offsetT) SFRAME_CFA_FIXED_RA_INVALID;
}
-/* Get the abi/arch indentifier for SFrame. */
+/* Get the abi/arch identifier for SFrame. */
unsigned char
aarch64_sframe_get_abi_arch (void)
@@ -10987,7 +10987,7 @@ aarch64_parse_arch (const char *str)
return aarch64_parse_features (ext, &march_cpu_opt, false);
}
- as_bad (_("unknown architecture `%s'\n"), str);
+ as_bad (_("unknown architecture `%s'"), str);
return 0;
}
@@ -11025,7 +11025,7 @@ aarch64_parse_abi (const char *str)
return 1;
}
- as_bad (_("unknown abi `%s'\n"), str);
+ as_bad (_("unknown abi `%s'"), str);
return 0;
}
@@ -11224,7 +11224,7 @@ s_aarch64_arch (int ignored ATTRIBUTE_UNUSED)
return;
}
- as_bad (_("unknown architecture `%s'\n"), name);
+ as_bad (_("unknown architecture `%s'"), name);
*input_line_pointer = saved_char;
ignore_rest_of_line ();
}
diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h
index acf1ce4..c2d0511 100644
--- a/gas/config/tc-aarch64.h
+++ b/gas/config/tc-aarch64.h
@@ -309,7 +309,7 @@ extern bool aarch64_sframe_ra_tracking_p (void);
extern offsetT aarch64_sframe_cfa_ra_offset (void);
#define sframe_cfa_ra_offset aarch64_sframe_cfa_ra_offset
-/* The abi/arch indentifier for SFrame. */
+/* The abi/arch identifier for SFrame. */
unsigned char aarch64_sframe_get_abi_arch (void);
#define sframe_get_abi_arch aarch64_sframe_get_abi_arch
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 822fd3d..1d401d1 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -3106,7 +3106,7 @@ find_real_start (symbolS * symbolP)
if (new_target == NULL)
{
- as_warn (_("Failed to find real start of function: %s\n"), name);
+ as_warn (_("Failed to find real start of function: %s"), name);
new_target = symbolP;
}
@@ -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. */
@@ -4256,7 +4260,7 @@ s_arm_unwind_save_pseudo (int regno)
add_unwind_opcode (op, 1);
break;
default:
- as_bad (_("Unknown register no. encountered: %d\n"), regno);
+ as_bad (_("Unknown register no. encountered: %d"), regno);
}
}
@@ -31855,7 +31859,7 @@ arm_parse_arch (const char *str)
return true;
}
- as_bad (_("unknown architecture `%s'\n"), str);
+ as_bad (_("unknown architecture `%s'"), str);
return false;
}
@@ -31871,7 +31875,7 @@ arm_parse_fpu (const char * str)
return true;
}
- as_bad (_("unknown floating point format `%s'\n"), str);
+ as_bad (_("unknown floating point format `%s'"), str);
return false;
}
@@ -31887,7 +31891,7 @@ arm_parse_float_abi (const char * str)
return true;
}
- as_bad (_("unknown floating point abi `%s'\n"), str);
+ as_bad (_("unknown floating point abi `%s'"), str);
return false;
}
@@ -31903,7 +31907,7 @@ arm_parse_eabi (const char * str)
meabi_flags = opt->value;
return true;
}
- as_bad (_("unknown EABI `%s'\n"), str);
+ as_bad (_("unknown EABI `%s'"), str);
return false;
}
#endif
@@ -32415,7 +32419,7 @@ aeabi_set_public_attributes (void)
if (arch == -1)
arch = get_aeabi_cpu_arch_from_fset (&flags_arch, &flags_ext, &profile, 0);
if (arch == -1)
- as_bad (_("no architecture contains all the instructions used\n"));
+ as_bad (_("no architecture contains all the instructions used"));
/* Tag_CPU_name. */
if (selected_cpu_name[0])
@@ -32675,7 +32679,7 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED)
return;
}
- as_bad (_("unknown architecture `%s'\n"), name);
+ as_bad (_("unknown architecture `%s'"), name);
*input_line_pointer = saved_char;
ignore_rest_of_line ();
}
@@ -32711,7 +32715,7 @@ s_arm_object_arch (int ignored ATTRIBUTE_UNUSED)
return;
}
- as_bad (_("unknown architecture `%s'\n"), name);
+ as_bad (_("unknown architecture `%s'"), name);
*input_line_pointer = saved_char;
ignore_rest_of_line ();
}
@@ -32813,7 +32817,7 @@ s_arm_arch_extension (int ignored ATTRIBUTE_UNUSED)
}
if (opt->name == NULL)
- as_bad (_("unknown architecture extension `%s'\n"), name);
+ as_bad (_("unknown architecture extension `%s'"), name);
*input_line_pointer = saved_char;
}
@@ -32854,7 +32858,7 @@ s_arm_fpu (int ignored ATTRIBUTE_UNUSED)
return;
}
- as_bad (_("unknown floating point format `%s'\n"), name);
+ as_bad (_("unknown floating point format `%s'"), name);
*input_line_pointer = saved_char;
ignore_rest_of_line ();
}
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2c61353..3e7040a 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -11968,7 +11968,7 @@ x86_sframe_cfa_ra_offset (void)
return (offsetT) -8;
}
-/* The abi/arch indentifier for SFrame. */
+/* The abi/arch identifier for SFrame. */
unsigned char
x86_sframe_get_abi_arch (void)
{
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 3fb7920..19eb0bc 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -471,7 +471,7 @@ extern bool x86_sframe_ra_tracking_p (void);
extern offsetT x86_sframe_cfa_ra_offset (void);
#define sframe_cfa_ra_offset x86_sframe_cfa_ra_offset
-/* The abi/arch indentifier for SFrame. */
+/* The abi/arch identifier for SFrame. */
extern unsigned char x86_sframe_get_abi_arch (void);
#define sframe_get_abi_arch x86_sframe_get_abi_arch
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 33f3a4c..0de2714 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -6140,9 +6140,6 @@ ppc_frob_symbol (symbolS *sym)
if (SF_GET_FUNCTION (sym))
{
- /* Make sure coff_last_function is reset. Otherwise, we won't create
- the auxent for the next function. */
- coff_last_function = 0;
ppc_last_function = sym;
if (symbol_get_tc (sym)->u.size != (symbolS *) NULL)
{
@@ -6170,10 +6167,6 @@ ppc_frob_symbol (symbolS *sym)
{
set_end = ppc_last_function;
ppc_last_function = NULL;
-
- /* We don't have a C_EFCN symbol, but we need to force the
- COFF backend to believe that it has seen one. */
- coff_last_function = NULL;
}
}
diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
index 5b5e7b1..5c8c7eb 100644
--- a/gas/gen-sframe.c
+++ b/gas/gen-sframe.c
@@ -1038,7 +1038,9 @@ sframe_xlate_do_def_cfa_register (struct sframe_xlate_ctx *xlate_ctx,
return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
}
sframe_fre_set_cfa_base_reg (cur_fre, cfi_insn->u.r);
- sframe_fre_set_cfa_offset (cur_fre, last_fre->cfa_offset);
+ if (last_fre)
+ sframe_fre_set_cfa_offset (cur_fre, last_fre->cfa_offset);
+
cur_fre->merge_candidate = false;
return SFRAME_XLATE_OK;
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index f8bab3c..780838d 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -330,21 +330,6 @@ switch -glob $target_triplet {
}
}
-# This test is for any COFF target.
-# We omit the ARM toolchains because they define locals to
-# start with '.', which eliminates .eos, .text etc from the output.
-# Omit c54x, since .tag and .def mean something different on that target
-if { ([istarget *-*-coff*] && ![istarget *c4x*-*-coff] && ![istarget *c54x*-*-coff]) \
- ||([istarget *-*-pe*] && ![istarget arm*-*-pe*]) \
- || [istarget i*86-*-aix*] \
- || [istarget i*86-*-go32*] \
- || [istarget i*86-*-cygwin*] \
- || [istarget x86_64-*-mingw*] \
- || [istarget i*86-*-*nt] \
- || [istarget i*86-*-interix*] } {
- run_dump_test cofftag
-}
-
# Test omitting conditionals from listings.
proc test_cond {} {
global comp_output
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.d
new file mode 100644
index 0000000..d779b6d
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.d
@@ -0,0 +1,21 @@
+#as: --gsframe
+#objdump: --sframe=.sframe
+#name: Check .cfi_def_cfa_register with no previous offset
+#...
+Contents of the SFrame section .sframe:
+
+ Header :
+
+ Version: SFRAME_VERSION_2
+ Flags: NONE
+#? CFA fixed FP offset: \-?\d+
+#? CFA fixed RA offset: \-?\d+
+ Num FDEs: 1
+ Num FREs: 1
+
+ Function Index :
+
+ func idx \[0\]: pc = 0x0, size = 0 bytes
+ STARTPC +CFA +FP +RA +
+ 0+0000 +fp\+8 +u +f +
+#pass
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.s
new file mode 100644
index 0000000..f3f9859
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-2.s
@@ -0,0 +1,4 @@
+# Although not a useful construct by itself, ensure graceful handling.
+ .cfi_startproc
+ .cfi_def_cfa_register 6
+ .cfi_endproc
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
index a099466..b353e27 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
@@ -90,6 +90,7 @@ if { [istarget "x86_64-*-*"] && [gas_sframe_check] } then {
if { [gas_x86_64_check] } then {
set ASFLAGS "$ASFLAGS --64"
run_dump_test "cfi-sframe-x86_64-1"
+ run_dump_test "cfi-sframe-x86_64-2"
run_dump_test "cfi-sframe-x86_64-empty-1"
run_dump_test "cfi-sframe-x86_64-empty-2"
run_dump_test "cfi-sframe-x86_64-empty-3"
diff --git a/gas/testsuite/gas/coff/coff.exp b/gas/testsuite/gas/coff/coff.exp
new file mode 100644
index 0000000..b5e7d24
--- /dev/null
+++ b/gas/testsuite/gas/coff/coff.exp
@@ -0,0 +1,40 @@
+# Copyright (C) 2012-2025 Free Software Foundation, Inc.
+
+# This program 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 3 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.
+
+#
+# coff tests
+#
+
+if { ![is_coff_format] } then {
+ return
+}
+
+# We omit the ARM toolchains because they define locals to start with '.',
+# which eliminates .eos, .text etc from the output.
+# Also omit c4x and c54x, since .tag and .def mean something different there.
+if { ![istarget arm*-*-*]
+ && ![istarget *c4x*-*-*]
+ && ![istarget *c54x*-*-*] } {
+ run_dump_test tag
+}
+
+# Omit c4x and c54x, since .def means something different there.
+if { ![istarget *c4x*-*-*] && ![istarget *c54x*-*-*] } {
+ run_dump_test func1
+ run_dump_test func2
+ run_dump_test func3
+ run_dump_test func4
+}
diff --git a/gas/testsuite/gas/coff/func1.d b/gas/testsuite/gas/coff/func1.d
new file mode 100644
index 0000000..c0bfa83
--- /dev/null
+++ b/gas/testsuite/gas/coff/func1.d
@@ -0,0 +1,16 @@
+#xfail: aarch64-*-*
+#objdump: -t
+#name: functions w/o C_EFCN
+
+.*: file format .*
+
+SYMBOL TABLE:
+\[ 0\]\(sec -2\)\(fl 0x00\)\(ty 0\)\(scl 103\) \(nx 1\) 0x0+0000 func1.c
+File *
+\[ 2\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+0000 inner
+AUX tagndx 0 ttlsiz 0x0 lnnos 0 next 4
+\[ 4\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+000. outer
+AUX tagndx 0 ttlsiz 0x0 lnnos 0 next 6
+\[ 6\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 2\) \(nx 1\) 0x0+000. test
+AUX tagndx 0 ttlsiz 0x0 lnnos 0 next 0
+#pass
diff --git a/gas/testsuite/gas/coff/func1.s b/gas/testsuite/gas/coff/func1.s
new file mode 100644
index 0000000..28300e7
--- /dev/null
+++ b/gas/testsuite/gas/coff/func1.s
@@ -0,0 +1,22 @@
+ .file "func1.c"
+ .text
+ .macro fcn, name
+ .def \name
+ .scl 3 /* C_STAT */
+ .type 32 /* DT_FUNC */
+ .endef
+\name:
+ .endm
+
+ fcn inner
+ .nop
+
+ fcn outer
+ .nop
+ .nop
+
+ .global test
+ fcn test
+ .nop
+ .nop
+ .nop
diff --git a/gas/testsuite/gas/coff/func2.d b/gas/testsuite/gas/coff/func2.d
new file mode 100644
index 0000000..55a3a25
--- /dev/null
+++ b/gas/testsuite/gas/coff/func2.d
@@ -0,0 +1,16 @@
+#xfail: aarch64-*-*
+#objdump: -t
+#name: functions w/ C_EFCN
+
+.*: file format .*
+
+SYMBOL TABLE:
+\[ 0\]\(sec -2\)\(fl 0x00\)\(ty 0\)\(scl 103\) \(nx 1\) 0x0+0000 func2.c
+File *
+\[ 2\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+0000 inner
+AUX tagndx 0 ttlsiz 0x[124] lnnos 0 next 4
+\[ 4\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+000. outer
+AUX tagndx 0 ttlsiz 0x[248] lnnos 0 next 6
+\[ 6\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 2\) \(nx 1\) 0x0+000. test
+AUX tagndx 0 ttlsiz 0x[36c] lnnos 0 next 0
+#pass
diff --git a/gas/testsuite/gas/coff/func2.s b/gas/testsuite/gas/coff/func2.s
new file mode 100644
index 0000000..75f2069
--- /dev/null
+++ b/gas/testsuite/gas/coff/func2.s
@@ -0,0 +1,34 @@
+ .file "func2.c"
+
+ .macro fcn, name
+ .def \name
+ .scl 3 /* C_STAT */
+ .type 32 /* DT_FUNC */
+ .endef
+\name:
+ .endm
+
+ .macro efcn, name
+ .def .\name
+ .scl 255 /* C_EFCN */
+ .val .
+ .endef
+ .endm
+
+ .text
+
+ fcn inner
+ .nop
+ efcn inner
+
+ fcn outer
+ .nop
+ .nop
+ efcn outer
+
+ .global test
+ fcn test
+ .nop
+ .nop
+ .nop
+ efcn test
diff --git a/gas/testsuite/gas/coff/func3.d b/gas/testsuite/gas/coff/func3.d
new file mode 100644
index 0000000..06b37f8
--- /dev/null
+++ b/gas/testsuite/gas/coff/func3.d
@@ -0,0 +1,16 @@
+#xfail: aarch64-*-*
+#objdump: -t
+#name: functions mixed C_EFCN
+
+.*: file format .*
+
+SYMBOL TABLE:
+\[ 0\]\(sec -2\)\(fl 0x00\)\(ty 0\)\(scl 103\) \(nx 1\) 0x0+0000 func3.c
+File *
+\[ 2\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+0000 inner
+AUX tagndx 0 ttlsiz 0x0 lnnos 0 next 4
+\[ 4\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+000. outer
+AUX tagndx 0 ttlsiz 0x[248] lnnos 0 next 6
+\[ 6\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 2\) \(nx 1\) 0x0+000. test
+AUX tagndx 0 ttlsiz 0x[36c] lnnos 0 next 0
+#pass
diff --git a/gas/testsuite/gas/coff/func3.s b/gas/testsuite/gas/coff/func3.s
new file mode 100644
index 0000000..5d41171
--- /dev/null
+++ b/gas/testsuite/gas/coff/func3.s
@@ -0,0 +1,33 @@
+ .file "func3.c"
+
+ .macro fcn, name
+ .def \name
+ .scl 3 /* C_STAT */
+ .type 32 /* DT_FUNC */
+ .endef
+\name:
+ .endm
+
+ .macro efcn, name
+ .def .\name
+ .scl 255 /* C_EFCN */
+ .val .
+ .endef
+ .endm
+
+ .text
+
+ fcn inner
+ .nop
+
+ fcn outer
+ .nop
+ .nop
+ efcn outer
+
+ .global test
+ fcn test
+ .nop
+ .nop
+ .nop
+ efcn test
diff --git a/gas/testsuite/gas/coff/func4.d b/gas/testsuite/gas/coff/func4.d
new file mode 100644
index 0000000..e7cd444
--- /dev/null
+++ b/gas/testsuite/gas/coff/func4.d
@@ -0,0 +1,18 @@
+#xfail: aarch64-*-*
+#objdump: -t
+#name: functions interleaved with data
+
+.*: file format .*
+
+SYMBOL TABLE:
+\[ 0\]\(sec -2\)\(fl 0x00\)\(ty 0\)\(scl 103\) \(nx 1\) 0x0+0000 func4.c
+File *
+\[ 2\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+0000 inner
+AUX tagndx 0 ttlsiz 0x[124] lnnos 0 next 5
+\[ 4\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 3\) \(nx 0\) 0x0+0000 item1
+\[ 5\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 3\) \(nx 1\) 0x0+000. outer
+AUX tagndx 0 ttlsiz 0x[248] lnnos 0 next 8
+\[ 7\]\(sec 2\)\(fl 0x00\)\(ty 0\)\(scl 3\) \(nx 0\) 0x0+000. item2
+\[ 8\]\(sec 1\)\(fl 0x00\)\(ty 20\)\(scl 2\) \(nx 1\) 0x0+000. test
+AUX tagndx 0 ttlsiz 0x[36c] lnnos 0 next 0
+#pass
diff --git a/gas/testsuite/gas/coff/func4.s b/gas/testsuite/gas/coff/func4.s
new file mode 100644
index 0000000..e9c75f4
--- /dev/null
+++ b/gas/testsuite/gas/coff/func4.s
@@ -0,0 +1,41 @@
+ .file "func4.c"
+
+ .macro fcn, name
+ .def \name
+ .scl 3 /* C_STAT */
+ .type 32 /* DT_FUNC */
+ .endef
+\name:
+ .endm
+
+ .macro efcn, name
+ .def .\name
+ .scl 255 /* C_EFCN */
+ .val .
+ .endef
+ .endm
+
+ .text
+ fcn inner
+ .nop
+ efcn inner
+
+ .data
+item1: .long -1
+
+ .text
+ fcn outer
+ .nop
+ .nop
+ efcn outer
+
+ .data
+item2: .long -2
+
+ .text
+ .global test
+ fcn test
+ .nop
+ .nop
+ .nop
+ efcn test
diff --git a/gas/testsuite/gas/all/cofftag.d b/gas/testsuite/gas/coff/tag.d
index 2d2a4cc..e366d4f 100644
--- a/gas/testsuite/gas/all/cofftag.d
+++ b/gas/testsuite/gas/coff/tag.d
@@ -5,7 +5,7 @@
SYMBOL TABLE:
\[ 0\]\(sec -2\)\(fl 0x00\)\(ty 0\)\(scl 103\) \(nx 1\) 0x0+0000 foo.c
-File
+File *
\[ 2\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 6\) \(nx 0\) 0x0+0000 gcc2_compiled.
\[ 3\]\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 6\) \(nx 0\) 0x0+0000 ___gnu_compiled_c
\[ 4\]\(sec -2\)\(fl 0x00\)\(ty a\)\(scl 15\) \(nx 1\) 0x0+0000 _token
diff --git a/gas/testsuite/gas/all/cofftag.s b/gas/testsuite/gas/coff/tag.s
index 814d3ed..a17c7f5 100644
--- a/gas/testsuite/gas/all/cofftag.s
+++ b/gas/testsuite/gas/coff/tag.s
@@ -4,7 +4,7 @@
operator,
flags
};
-
+
enum token what= operator;
Type numbers have been converted to decimal to make this test pass on
diff --git a/gas/testsuite/gas/loongarch/div_zero.l b/gas/testsuite/gas/loongarch/div_zero.l
new file mode 100644
index 0000000..b30c665
--- /dev/null
+++ b/gas/testsuite/gas/loongarch/div_zero.l
@@ -0,0 +1,4 @@
+#source: div_zero.s
+.*: Assembler messages:
+.*: Warning: Divide by zero!
+.*: Warning: Divide by zero!
diff --git a/gas/testsuite/gas/loongarch/div_zero.s b/gas/testsuite/gas/loongarch/div_zero.s
new file mode 100644
index 0000000..44a5c26
--- /dev/null
+++ b/gas/testsuite/gas/loongarch/div_zero.s
@@ -0,0 +1,2 @@
+addi.w $a0,$a1,2/0
+addi.d $a0,$a1,4%0
diff --git a/gas/testsuite/gas/loongarch/loongarch.exp b/gas/testsuite/gas/loongarch/loongarch.exp
index 0e836f7..d2008f4 100644
--- a/gas/testsuite/gas/loongarch/loongarch.exp
+++ b/gas/testsuite/gas/loongarch/loongarch.exp
@@ -37,5 +37,6 @@ if [istarget loongarch*-*-*] {
run_list_test "illegal-operand"
run_list_test "pseudo_op_option_fail"
run_list_test "negative_right_shift"
+ run_list_test "div_zero"
}
}
diff --git a/gas/testsuite/gas/ppc/future.d b/gas/testsuite/gas/ppc/future.d
index 76a30a5..5c008b5 100644
--- a/gas/testsuite/gas/ppc/future.d
+++ b/gas/testsuite/gas/ppc/future.d
@@ -57,4 +57,39 @@ Disassembly of section \.text:
.*: (d0 1e 22 f0|f0 22 1e d0) xxgfmul128gcm vs1,vs2,vs3
.*: (d6 0f e0 f3|f3 e0 0f d6) xxgfmul128xts vs31,vs32,vs33
.*: (d6 0f e0 f3|f3 e0 0f d6) xxgfmul128xts vs31,vs32,vs33
+.*: (06 00 00 00|00 00 00 06) paddis r12,r9,15
+.*: (3d 89 00 0f|0f 00 89 3d)
+.*: (06 00 00 00|00 00 00 06) paddis r12,r9,15
+.*: (3d 89 00 0f|0f 00 89 3d)
+.*: (06 00 ff ff|ff ff 00 06) paddis r12,r9,-32769
+.*: (3d 89 7f ff|ff 7f 89 3d)
+.*: (06 00 ff ff|ff ff 00 06) paddis r12,r9,-32769
+.*: (3d 89 7f ff|ff 7f 89 3d)
+.*: (06 10 00 00|00 00 10 06) paddis r9,0,25,1 # e4
+.*: (3d 20 00 19|19 00 20 3d)
+.*: (06 00 7f ff|ff 7f 00 06) plis r24,2147483647
+.*: (3f 00 ff ff|ff ff 00 3f)
+.*: (06 00 7f ff|ff 7f 00 06) plis r24,2147483647
+.*: (3f 00 ff ff|ff ff 00 3f)
+.*: (60 00 00 00|00 00 00 60) nop
+.*: (06 00 7f ff|ff 7f 00 06) plis r24,2147483647
+.*: (3f 00 ff ff|ff ff 00 3f)
+.*: (06 00 80 00|00 80 00 06) paddis r30,r10,-2147483648
+.*: (3f ca 00 00|00 00 ca 3f)
+.*: (06 00 80 00|00 80 00 06) paddis r30,r10,-2147483648
+.*: (3f ca 00 00|00 00 ca 3f)
+.*: (06 00 80 00|00 80 00 06) paddis r30,r10,-2147483648
+.*: (3f ca 00 00|00 00 ca 3f)
+.*: (60 00 00 00|00 00 00 60) nop
+.*: (06 00 7f ff|ff 7f 00 06) paddis r30,r10,2147483647
+.*: (3f ca ff ff|ff ff ca 3f)
+.*: (06 00 7f ff|ff 7f 00 06) paddis r30,r10,2147483647
+.*: (3f ca ff ff|ff ff ca 3f)
+.*: (06 00 7f ff|ff 7f 00 06) paddis r30,r10,2147483647
+.*: (3f ca ff ff|ff ff ca 3f)
+.*: (60 00 00 00|00 00 00 60) nop
+.*: (06 10 7f ff|ff 7f 10 06) paddis r15,0,2147483647,1 # 140
+.* (3d e0 ff ff|ff ff e0 3d)
+.*: (06 10 7f ff|ff 7f 10 06) paddis r15,0,2147483647,1 # 148
+.* (3d e0 ff ff|ff ff e0 3d)
#pass
diff --git a/gas/testsuite/gas/ppc/future.s b/gas/testsuite/gas/ppc/future.s
index fec99e3..55867de 100644
--- a/gas/testsuite/gas/ppc/future.s
+++ b/gas/testsuite/gas/ppc/future.s
@@ -49,3 +49,21 @@ _start:
xxgfmul128gcm 1, 2, 3
xxgfmul128 31, 32, 33, 1
xxgfmul128xts 31, 32, 33
+ paddis 12, 9, 15, 0
+ paddis 12, 9, 15
+ paddis 12, 9, ~(1<<15), 0
+ paddis 12, 9, ~(1<<15)
+ paddis 9, 0, 25, 1
+ paddis 24, 0, 2147483647, 0
+ paddis 24, 0, 2147483647
+ plis 24, 2147483647
+ paddis 30, 10, -2147483648, 0
+ paddis 30, 10, -2147483648
+ psubis 30, 10, 2147483648, 0
+ nop
+ paddis 30, 10, 2147483647, 0
+ paddis 30, 10, 2147483647
+ psubis 30, 10, -2147483647, 0
+ paddis 15, 0, 2147483647, 1
+ psubis 15, 0, -2147483647, 1
+