aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-03-17 11:01:38 +0100
committerJan Beulich <jbeulich@suse.com>2022-03-17 11:01:38 +0100
commit648d04db39d0f8d69d5f4d47a86c7bd9ecc10e85 (patch)
tree58b7b57747e6365326402eb772ea1cc3f786e71d /gas/config
parent4417601f70ce20397dccd1884c2e0c44f25d9b3c (diff)
downloadgdb-648d04db39d0f8d69d5f4d47a86c7bd9ecc10e85.zip
gdb-648d04db39d0f8d69d5f4d47a86c7bd9ecc10e85.tar.gz
gdb-648d04db39d0f8d69d5f4d47a86c7bd9ecc10e85.tar.bz2
x86: assorted IAMCU CPU checking fixes
The checks done by check_cpu_arch_compatible() were halfway sensible only at the time where only L1OM support was there. The purpose, however, has always been to prevent bad uses of .arch (turning off the base CPU "feature" flag) while at the same time permitting extensions to be enabled / disabled. In order to achieve this (and to prevent regressions when L1OM and K1OM support are removed) - set CpuIAMCU in CPU_IAMCU_FLAGS, - adjust the IAMCU check in the function itself (the other two similarly broken checks aren't adjusted as they're slated to be removed anyway), - avoid calling the function for extentions (which would never have the base "feature" flag set), - add a new testcase actually exercising ".arch iamcu" (which would also regress with the planned removal).
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index e063268..e1fd758 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2839,8 +2839,8 @@ check_cpu_arch_compatible (const char *name ATTRIBUTE_UNUSED,
}
/* If we are targeting Intel MCU, we must enable it. */
- if (get_elf_backend_data (stdoutput)->elf_machine_code != EM_IAMCU
- || new_flag.bitfield.cpuiamcu)
+ if ((get_elf_backend_data (stdoutput)->elf_machine_code == EM_IAMCU)
+ == new_flag.bitfield.cpuiamcu)
return;
/* If we are targeting Intel L1OM, we must enable it. */
@@ -2873,10 +2873,10 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED)
{
if (strcmp (string, cpu_arch[j].name) == 0)
{
- check_cpu_arch_compatible (string, cpu_arch[j].flags);
-
if (*string != '.')
{
+ check_cpu_arch_compatible (string, cpu_arch[j].flags);
+
cpu_arch_name = cpu_arch[j].name;
cpu_sub_arch_name = NULL;
cpu_arch_flags = cpu_arch[j].flags;