diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-03-15 21:38:30 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-03-21 16:44:49 +0000 |
commit | a9522a2168c8233e8f15c42a32e7376c2a40ac12 (patch) | |
tree | 9473adba31cd236816ce37b27f9994486fb9252d /gas | |
parent | c0334580516d147fb0257a2df47ac7b1072f6e82 (diff) | |
download | gdb-a9522a2168c8233e8f15c42a32e7376c2a40ac12.zip gdb-a9522a2168c8233e8f15c42a32e7376c2a40ac12.tar.gz gdb-a9522a2168c8233e8f15c42a32e7376c2a40ac12.tar.bz2 |
arc: Remove EF_ARC_CPU_GENERIC constant.
The constant EF_ARC_CPU_GENERIC is defined in the include/elf/arc.h
file, and is used in a few places in binutils, however, this constant
should never make it into the elf header flags; we always set a valid
cpu type in the assembler, which should then be copied over during
linking.
There are some non-gnu arc compilers that don't write an architecture
type into the e_flags field, instead leaving the field as 0, which is
the EF_ARC_CPU_GENERIC value. This non-gnu compiler uses the machine
type to distinguish between the old and newer arc architectures, setting
the machine type to EM_ARC_COMPACT for old arc600, arc601, and arc700
architectures, while using EM_ARC_COMPACT2 for newer arcem and archs
architectures.
Previously when displaying the machine flags for an older EM_ARC_COMPACT
machine, if the e_flags had not been filled in, then we relied on the
default case statement to display the message "Generic ARCompact", while
in the EM_ARC_COMPACT2 case we specifically handled EF_ARC_CPU_GENERIC
to print "ARC Generic", leaving the default case to print a message
about unrecognised cpu flag.
After this commit EF_ARC_CPU_GENERIC has been removed, for both machine
types EM_ARC_COMPACT and EM_ARC_COMPACT2 we now rely on the default case
statement to handle the situation where the e_flags has not been filled
in. The message displayed is now "Unknown ARCompact" (for older arc
architectures) and "Unknown ARC" (for the newer architectures). The
switch from "Generic" to "Unknown" in the message string is for clarity,
calling the file "Generic" can give the impression that the file is
compiled for a common sub-set of the architectures, and would therefore
run on any type of machine (or at least any type of new or old machine
depending on if the machine type is ARC or ARCv2). However, this was
not what "Generic" meant, it really meant "Unknown", so that's what we
now say.
As part of the merging of the readelf flag reading code, I have unified
the strings used in displaying the ELF ABI. This means that for older
arc machines (arc600, arc601, and arc700) the string used for the
original ABI, and ABIv2 have changed, the current ABIv3 remains the
same. For the newer architectures (arcem and archs) the abi strings
remain unchanged in all cases.
bfd/ChangeLog:
* elf32-arc.c (arc_elf_print_private_bfd_data): Remove use of
EF_ARC_CPU_GENERIC.
(arc_elf_final_write_processing): Don't bother setting cpu field
in e_flags, this will have been set elsewhere.
binutils/ChangeLog:
* readelf.c (get_machine_flags): Move arc processing into...
(decode_ARC_machine_flags): ... new function. Remove use of
EF_ARC_CPU_GENERIC, change default case from "generic arc" to
"unknown arc". Merged ABI printing between two machine types.
gas/ChangeLog:
* config/tc-arc.c (arc_select_cpu): Remove use of
EF_ARC_CPU_GENERIC.
include/ChangeLog:
* elf/arc.h (EF_ARC_CPU_GENERIC): Delete. Update related comment.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-arc.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index a4d9b67..c6aa311 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2016-03-21 Andrew Burgess <andrew.burgess@embecosm.com> + * config/tc-arc.c (arc_select_cpu): Remove use of + EF_ARC_CPU_GENERIC. + +2016-03-21 Andrew Burgess <andrew.burgess@embecosm.com> + * config/tc-arc.c (arc_target): Delay initialisation until arc_select_cpu. (arc_target_name): Likewise. diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 56339054..65eb0e9 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -573,7 +573,7 @@ md_number_to_chars_midend (char *buf, valueT val, int n) static void arc_select_cpu (const char *arg) { - int cpu_flags = EF_ARC_CPU_GENERIC; + int cpu_flags = 0; int i; for (i = 0; cpu_types[i].name; ++i) @@ -591,9 +591,8 @@ arc_select_cpu (const char *arg) if (!cpu_types[i].name) as_fatal (_("unknown architecture: %s\n"), arg); - - if (cpu_flags != EF_ARC_CPU_GENERIC) - arc_eflag = (arc_eflag & ~EF_ARC_MACH_MSK) | cpu_flags; + gas_assert (cpu_flags != 0); + arc_eflag = (arc_eflag & ~EF_ARC_MACH_MSK) | cpu_flags; } /* Here ends all the ARCompact extension instruction assembling |