aboutsummaryrefslogtreecommitdiff
path: root/bfd/cpu-arm.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@linaro.org>2018-11-27 18:27:35 +0000
committerThomas Preud'homme <thomas.preudhomme@linaro.org>2018-11-27 18:28:35 +0000
commitb5ab31636d36e1252791cec179aa11ab9d9b87e9 (patch)
tree1c0778275b77d846251bda1a309f606b81dd0977 /bfd/cpu-arm.c
parent3c7687b9cdacc243f7e23cd9b144e72b88d58817 (diff)
downloadgdb-b5ab31636d36e1252791cec179aa11ab9d9b87e9.zip
gdb-b5ab31636d36e1252791cec179aa11ab9d9b87e9.tar.gz
gdb-b5ab31636d36e1252791cec179aa11ab9d9b87e9.tar.bz2
[ARM] Update knowledge of bfd architectures
Commit c0c468d562649df0f695737262b6230b7a56a4bb updated bfd's knowledge of Arm architectures to Armv5TEJ and later but missed the list of CPUs recognized by objdump -d -m<cpu>. .note.gnu.arm.ident related code is intentionally not updated as build attributes are a better mechanism to express the ISA in a file. However this patch adds tests for the existing code since no existing testcase cover those codepaths. Since I've only ever managed for bfd_arm_get_mach_from_notes () to have an effect by using objcopy on a file with a note but no Arm build attribute, the tests make use of both objcopy actions supported by run_dump_test which requires to have a ld line as well. Note that the CPU list in bfd/cpu-arm.c was simply copied over from GAS' CPU list but sorted alphabetically as already done for existing entries. 2018-11-27 Thomas Preud'homme <thomas.preudhomme@linaro.org> bfd/ * cpu-arm.c (processors): Add processors known to GAS but missing here and reindent. (bfd_arm_update_notes): Add comment explaining why the list of architectures in the switch should not be updated. (architectures): Likewise. gas/ * testsuite/gas/arm/cpu-arm1020.d: New testcase. * testsuite/gas/arm/cpu-arm1020e.d: Likewise. * testsuite/gas/arm/cpu-arm1020t.d: Likewise. * testsuite/gas/arm/cpu-arm1022e.d: Likewise. * testsuite/gas/arm/cpu-arm1026ej-s.d: Likewise. * testsuite/gas/arm/cpu-arm1026ejs.d: Likewise. * testsuite/gas/arm/cpu-arm10e.d: Likewise. * testsuite/gas/arm/cpu-arm10t.d: Likewise. * testsuite/gas/arm/cpu-arm10tdmi.d: Likewise. * testsuite/gas/arm/cpu-arm1136j-s.d: Likewise. * testsuite/gas/arm/cpu-arm1136jf-s.d: Likewise. * testsuite/gas/arm/cpu-arm1136jfs.d: Likewise. * testsuite/gas/arm/cpu-arm1136js.d: Likewise. * testsuite/gas/arm/cpu-arm1156t2-s.d: Likewise. * testsuite/gas/arm/cpu-arm1156t2f-s.d: Likewise. * testsuite/gas/arm/cpu-arm1176jz-s.d: Likewise. * testsuite/gas/arm/cpu-arm1176jzf-s.d: Likewise. * testsuite/gas/arm/cpu-arm2.d: Likewise. * testsuite/gas/arm/cpu-arm250.d: Likewise. * testsuite/gas/arm/cpu-arm3.d: Likewise. * testsuite/gas/arm/cpu-arm6.d: Likewise. * testsuite/gas/arm/cpu-arm60.d: Likewise. * testsuite/gas/arm/cpu-arm600.d: Likewise. * testsuite/gas/arm/cpu-arm610.d: Likewise. * testsuite/gas/arm/cpu-arm620.d: Likewise. * testsuite/gas/arm/cpu-arm7.d: Likewise. * testsuite/gas/arm/cpu-arm70.d: Likewise. * testsuite/gas/arm/cpu-arm700.d: Likewise. * testsuite/gas/arm/cpu-arm700i.d: Likewise. * testsuite/gas/arm/cpu-arm710.d: Likewise. * testsuite/gas/arm/cpu-arm7100.d: Likewise. * testsuite/gas/arm/cpu-arm710c.d: Likewise. * testsuite/gas/arm/cpu-arm710t.d: Likewise. * testsuite/gas/arm/cpu-arm720.d: Likewise. * testsuite/gas/arm/cpu-arm720t.d: Likewise. * testsuite/gas/arm/cpu-arm740t.d: Likewise. * testsuite/gas/arm/cpu-arm7500.d: Likewise. * testsuite/gas/arm/cpu-arm7500fe.d: Likewise. * testsuite/gas/arm/cpu-arm7d.d: Likewise. * testsuite/gas/arm/cpu-arm7di.d: Likewise. * testsuite/gas/arm/cpu-arm7dm.d: Likewise. * testsuite/gas/arm/cpu-arm7dmi.d: Likewise. * testsuite/gas/arm/cpu-arm7m.d: Likewise. * testsuite/gas/arm/cpu-arm7t.d: Likewise. * testsuite/gas/arm/cpu-arm7tdmi-s.d: Likewise. * testsuite/gas/arm/cpu-arm7tdmi.d: Likewise. * testsuite/gas/arm/cpu-arm8.d: Likewise. * testsuite/gas/arm/cpu-arm810.d: Likewise. * testsuite/gas/arm/cpu-arm9.d: Likewise. * testsuite/gas/arm/cpu-arm920.d: Likewise. * testsuite/gas/arm/cpu-arm920t.d: Likewise. * testsuite/gas/arm/cpu-arm922t.d: Likewise. * testsuite/gas/arm/cpu-arm926ej-s.d: Likewise. * testsuite/gas/arm/cpu-arm926ej.d: Likewise. * testsuite/gas/arm/cpu-arm926ejs.d: Likewise. * testsuite/gas/arm/cpu-arm940t.d: Likewise. * testsuite/gas/arm/cpu-arm946e-r0.d: Likewise. * testsuite/gas/arm/cpu-arm946e-s.d: Likewise. * testsuite/gas/arm/cpu-arm946e.d: Likewise. * testsuite/gas/arm/cpu-arm966e-r0.d: Likewise. * testsuite/gas/arm/cpu-arm966e-s.d: Likewise. * testsuite/gas/arm/cpu-arm966e.d: Likewise. * testsuite/gas/arm/cpu-arm968e-s.d: Likewise. * testsuite/gas/arm/cpu-arm9e-r0.d: Likewise. * testsuite/gas/arm/cpu-arm9e.d: Likewise. * testsuite/gas/arm/cpu-arm9tdmi.d: Likewise. * testsuite/gas/arm/cpu-arm_any.d: Likewise. * testsuite/gas/arm/cpu-cortex-a12.d: Likewise. * testsuite/gas/arm/cpu-cortex-a15.d: Likewise. * testsuite/gas/arm/cpu-cortex-a17.d: Likewise. * testsuite/gas/arm/cpu-cortex-a32.d: Likewise. * testsuite/gas/arm/cpu-cortex-a35.d: Likewise. * testsuite/gas/arm/cpu-cortex-a5.d: Likewise. * testsuite/gas/arm/cpu-cortex-a53.d: Likewise. * testsuite/gas/arm/cpu-cortex-a55.d: Likewise. * testsuite/gas/arm/cpu-cortex-a57.d: Likewise. * testsuite/gas/arm/cpu-cortex-a7.d: Likewise. * testsuite/gas/arm/cpu-cortex-a72.d: Likewise. * testsuite/gas/arm/cpu-cortex-a73.d: Likewise. * testsuite/gas/arm/cpu-cortex-a75.d: Likewise. * testsuite/gas/arm/cpu-cortex-a76.d: Likewise. * testsuite/gas/arm/cpu-cortex-a8.d: Likewise. * testsuite/gas/arm/cpu-cortex-a9.d: Likewise. * testsuite/gas/arm/cpu-cortex-m0.d: Likewise. * testsuite/gas/arm/cpu-cortex-m0plus.d: Likewise. * testsuite/gas/arm/cpu-cortex-m1.d: Likewise. * testsuite/gas/arm/cpu-cortex-m23.d: Likewise. * testsuite/gas/arm/cpu-cortex-m3.d: Likewise. * testsuite/gas/arm/cpu-cortex-m33.d: Likewise. * testsuite/gas/arm/cpu-cortex-m4.d: Likewise. * testsuite/gas/arm/cpu-cortex-m7.d: Likewise. * testsuite/gas/arm/cpu-cortex-r4.d: Likewise. * testsuite/gas/arm/cpu-cortex-r4f.d: Likewise. * testsuite/gas/arm/cpu-cortex-r5.d: Likewise. * testsuite/gas/arm/cpu-cortex-r52.d: Likewise. * testsuite/gas/arm/cpu-cortex-r7.d: Likewise. * testsuite/gas/arm/cpu-cortex-r8.d: Likewise. * testsuite/gas/arm/cpu-ep9312.d: Likewise. * testsuite/gas/arm/cpu-exynos-m1.d: Likewise. * testsuite/gas/arm/cpu-fa526.d: Likewise. * testsuite/gas/arm/cpu-fa606te.d: Likewise. * testsuite/gas/arm/cpu-fa616te.d: Likewise. * testsuite/gas/arm/cpu-fa626.d: Likewise. * testsuite/gas/arm/cpu-fa626te.d: Likewise. * testsuite/gas/arm/cpu-fa726te.d: Likewise. * testsuite/gas/arm/cpu-fmp626.d: Likewise. * testsuite/gas/arm/cpu-i80200.d: Likewise. * testsuite/gas/arm/cpu-iwmmxt.d: Likewise. * testsuite/gas/arm/cpu-iwmmxt2.d: Likewise. * testsuite/gas/arm/cpu-marvell-pj4.d: Likewise. * testsuite/gas/arm/cpu-marvell-whitney.d: Likewise. * testsuite/gas/arm/cpu-mpcore.d: Likewise. * testsuite/gas/arm/cpu-mpcorenovfp.d: Likewise. * testsuite/gas/arm/cpu-sa1.d: Likewise. * testsuite/gas/arm/cpu-strongarm.d: Likewise. * testsuite/gas/arm/cpu-strongarm1.d: Likewise. * testsuite/gas/arm/cpu-strongarm110.d: Likewise. * testsuite/gas/arm/cpu-strongarm1100.d: Likewise. * testsuite/gas/arm/cpu-strongarm1110.d: Likewise. * testsuite/gas/arm/cpu-xgene1.d: Likewise. * testsuite/gas/arm/cpu-xgene2.d: Likewise. * testsuite/gas/arm/cpu-xscale.d: Likewise. * testsuite/gas/arm/nop-asm.s: Likewise. * testsuite/gas/arm/note-march-armv2.d: Likewise. * testsuite/gas/arm/note-march-armv2.s: Likewise. * testsuite/gas/arm/note-march-armv2a.d: Likewise. * testsuite/gas/arm/note-march-armv2a.s: Likewise. * testsuite/gas/arm/note-march-armv3.d: Likewise. * testsuite/gas/arm/note-march-armv3.s: Likewise. * testsuite/gas/arm/note-march-armv3m.d: Likewise. * testsuite/gas/arm/note-march-armv3m.s: Likewise. * testsuite/gas/arm/note-march-armv4.d: Likewise. * testsuite/gas/arm/note-march-armv4.s: Likewise. * testsuite/gas/arm/note-march-armv4t.d: Likewise. * testsuite/gas/arm/note-march-armv4t.s: Likewise. * testsuite/gas/arm/note-march-armv5.d: Likewise. * testsuite/gas/arm/note-march-armv5.s: Likewise. * testsuite/gas/arm/note-march-armv5t.d: Likewise. * testsuite/gas/arm/note-march-armv5t.s: Likewise. * testsuite/gas/arm/note-march-armv5te.d: Likewise. * testsuite/gas/arm/note-march-armv5te.d: Likewise. * testsuite/gas/arm/note-march-ep9312.d: Likewise. * testsuite/gas/arm/note-march-ep9312.s: Likewise. * testsuite/gas/arm/note-march-iwmmxt.d: Likewise. * testsuite/gas/arm/note-march-iwmmxt.s: Likewise. * testsuite/gas/arm/note-march-iwmmxt2.d: Likewise. * testsuite/gas/arm/note-march-iwmmxt2.s: Likewise. * testsuite/gas/arm/note-march-xscale.d: Likewise. * testsuite/gas/arm/note-march-xscale.s: Likewise.
Diffstat (limited to 'bfd/cpu-arm.c')
-rw-r--r--bfd/cpu-arm.c160
1 files changed, 129 insertions, 31 deletions
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index 4ef409b..120e57f 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -65,36 +65,129 @@ static struct
}
processors[] =
{
- { bfd_mach_arm_2, "arm2" },
- { bfd_mach_arm_2a, "arm250" },
- { bfd_mach_arm_2a, "arm3" },
- { bfd_mach_arm_3, "arm6" },
- { bfd_mach_arm_3, "arm60" },
- { bfd_mach_arm_3, "arm600" },
- { bfd_mach_arm_3, "arm610" },
- { bfd_mach_arm_3, "arm7" },
- { bfd_mach_arm_3, "arm710" },
- { bfd_mach_arm_3, "arm7500" },
- { bfd_mach_arm_3, "arm7d" },
- { bfd_mach_arm_3, "arm7di" },
- { bfd_mach_arm_3M, "arm7dm" },
- { bfd_mach_arm_3M, "arm7dmi" },
- { bfd_mach_arm_4T, "arm7tdmi" },
- { bfd_mach_arm_4, "arm8" },
- { bfd_mach_arm_4, "arm810" },
- { bfd_mach_arm_4, "arm9" },
- { bfd_mach_arm_4, "arm920" },
- { bfd_mach_arm_4T, "arm920t" },
- { bfd_mach_arm_4T, "arm9tdmi" },
- { bfd_mach_arm_4, "sa1" },
- { bfd_mach_arm_4, "strongarm"},
- { bfd_mach_arm_4, "strongarm110" },
- { bfd_mach_arm_4, "strongarm1100" },
- { bfd_mach_arm_XScale, "xscale" },
- { bfd_mach_arm_ep9312, "ep9312" },
- { bfd_mach_arm_iWMMXt, "iwmmxt" },
- { bfd_mach_arm_iWMMXt2, "iwmmxt2" },
- { bfd_mach_arm_unknown, "arm_any" }
+ { bfd_mach_arm_2, "arm2" },
+ { bfd_mach_arm_2a, "arm250" },
+ { bfd_mach_arm_2a, "arm3" },
+ { bfd_mach_arm_3, "arm6" },
+ { bfd_mach_arm_3, "arm60" },
+ { bfd_mach_arm_3, "arm600" },
+ { bfd_mach_arm_3, "arm610" },
+ { bfd_mach_arm_3, "arm620" },
+ { bfd_mach_arm_3, "arm7" },
+ { bfd_mach_arm_3, "arm70" },
+ { bfd_mach_arm_3, "arm700" },
+ { bfd_mach_arm_3, "arm700i" },
+ { bfd_mach_arm_3, "arm710" },
+ { bfd_mach_arm_3, "arm7100" },
+ { bfd_mach_arm_3, "arm710c" },
+ { bfd_mach_arm_4T, "arm710t" },
+ { bfd_mach_arm_3, "arm720" },
+ { bfd_mach_arm_4T, "arm720t" },
+ { bfd_mach_arm_4T, "arm740t" },
+ { bfd_mach_arm_3, "arm7500" },
+ { bfd_mach_arm_3, "arm7500fe" },
+ { bfd_mach_arm_3, "arm7d" },
+ { bfd_mach_arm_3, "arm7di" },
+ { bfd_mach_arm_3M, "arm7dm" },
+ { bfd_mach_arm_3M, "arm7dmi" },
+ { bfd_mach_arm_4T, "arm7t" },
+ { bfd_mach_arm_4T, "arm7tdmi" },
+ { bfd_mach_arm_4T, "arm7tdmi-s" },
+ { bfd_mach_arm_3M, "arm7m" },
+ { bfd_mach_arm_4, "arm8" },
+ { bfd_mach_arm_4, "arm810" },
+ { bfd_mach_arm_4, "arm9" },
+ { bfd_mach_arm_4T, "arm920" },
+ { bfd_mach_arm_4T, "arm920t" },
+ { bfd_mach_arm_4T, "arm922t" },
+ { bfd_mach_arm_5TEJ, "arm926ej" },
+ { bfd_mach_arm_5TEJ, "arm926ejs" },
+ { bfd_mach_arm_5TEJ, "arm926ej-s" },
+ { bfd_mach_arm_4T, "arm940t" },
+ { bfd_mach_arm_5TE, "arm946e" },
+ { bfd_mach_arm_5TE, "arm946e-r0" },
+ { bfd_mach_arm_5TE, "arm946e-s" },
+ { bfd_mach_arm_5TE, "arm966e" },
+ { bfd_mach_arm_5TE, "arm966e-r0" },
+ { bfd_mach_arm_5TE, "arm966e-s" },
+ { bfd_mach_arm_5TE, "arm968e-s" },
+ { bfd_mach_arm_5TE, "arm9e" },
+ { bfd_mach_arm_5TE, "arm9e-r0" },
+ { bfd_mach_arm_4T, "arm9tdmi" },
+ { bfd_mach_arm_5TE, "arm1020" },
+ { bfd_mach_arm_5T, "arm1020t" },
+ { bfd_mach_arm_5TE, "arm1020e" },
+ { bfd_mach_arm_5TE, "arm1022e" },
+ { bfd_mach_arm_5TEJ, "arm1026ejs" },
+ { bfd_mach_arm_5TEJ, "arm1026ej-s" },
+ { bfd_mach_arm_5TE, "arm10e" },
+ { bfd_mach_arm_5T, "arm10t" },
+ { bfd_mach_arm_5T, "arm10tdmi" },
+ { bfd_mach_arm_6, "arm1136j-s" },
+ { bfd_mach_arm_6, "arm1136js" },
+ { bfd_mach_arm_6, "arm1136jf-s" },
+ { bfd_mach_arm_6, "arm1136jfs" },
+ { bfd_mach_arm_6KZ, "arm1176jz-s" },
+ { bfd_mach_arm_6KZ, "arm1176jzf-s" },
+ { bfd_mach_arm_6T2, "arm1156t2-s" },
+ { bfd_mach_arm_6T2, "arm1156t2f-s" },
+ { bfd_mach_arm_7, "cortex-a5" },
+ { bfd_mach_arm_7, "cortex-a7" },
+ { bfd_mach_arm_7, "cortex-a8" },
+ { bfd_mach_arm_7, "cortex-a9" },
+ { bfd_mach_arm_7, "cortex-a12" },
+ { bfd_mach_arm_7, "cortex-a15" },
+ { bfd_mach_arm_7, "cortex-a17" },
+ { bfd_mach_arm_8, "cortex-a32" },
+ { bfd_mach_arm_8, "cortex-a35" },
+ { bfd_mach_arm_8, "cortex-a53" },
+ { bfd_mach_arm_8, "cortex-a55" },
+ { bfd_mach_arm_8, "cortex-a57" },
+ { bfd_mach_arm_8, "cortex-a72" },
+ { bfd_mach_arm_8, "cortex-a73" },
+ { bfd_mach_arm_8, "cortex-a75" },
+ { bfd_mach_arm_8, "cortex-a76" },
+ { bfd_mach_arm_6SM, "cortex-m0" },
+ { bfd_mach_arm_6SM, "cortex-m0plus" },
+ { bfd_mach_arm_6SM, "cortex-m1" },
+ { bfd_mach_arm_8M_BASE, "cortex-m23" },
+ { bfd_mach_arm_7, "cortex-m3" },
+ { bfd_mach_arm_8M_MAIN, "cortex-m33" },
+ { bfd_mach_arm_7EM, "cortex-m4" },
+ { bfd_mach_arm_7EM, "cortex-m7" },
+ { bfd_mach_arm_7, "cortex-r4" },
+ { bfd_mach_arm_7, "cortex-r4f" },
+ { bfd_mach_arm_7, "cortex-r5" },
+ { bfd_mach_arm_8R, "cortex-r52" },
+ { bfd_mach_arm_7, "cortex-r7" },
+ { bfd_mach_arm_7, "cortex-r8" },
+ { bfd_mach_arm_4T, "ep9312" },
+ { bfd_mach_arm_8, "exynos-m1" },
+ { bfd_mach_arm_4, "fa526" },
+ { bfd_mach_arm_5TE, "fa606te" },
+ { bfd_mach_arm_5TE, "fa616te" },
+ { bfd_mach_arm_4, "fa626" },
+ { bfd_mach_arm_5TE, "fa626te" },
+ { bfd_mach_arm_5TE, "fa726te" },
+ { bfd_mach_arm_5TE, "fmp626" },
+ { bfd_mach_arm_XScale, "i80200" },
+ { bfd_mach_arm_7, "marvell-pj4" },
+ { bfd_mach_arm_7, "marvell-whitney" },
+ { bfd_mach_arm_6K, "mpcore" },
+ { bfd_mach_arm_6K, "mpcorenovfp" },
+ { bfd_mach_arm_4, "sa1" },
+ { bfd_mach_arm_4, "strongarm" },
+ { bfd_mach_arm_4, "strongarm1" },
+ { bfd_mach_arm_4, "strongarm110" },
+ { bfd_mach_arm_4, "strongarm1100" },
+ { bfd_mach_arm_4, "strongarm1110" },
+ { bfd_mach_arm_XScale, "xscale" },
+ { bfd_mach_arm_8, "xgene1" },
+ { bfd_mach_arm_8, "xgene2" },
+ { bfd_mach_arm_ep9312, "ep9312" },
+ { bfd_mach_arm_iWMMXt, "iwmmxt" },
+ { bfd_mach_arm_iWMMXt2, "iwmmxt2" },
+ { bfd_mach_arm_unknown, "arm_any" }
};
static bfd_boolean
@@ -317,7 +410,9 @@ bfd_arm_update_notes (bfd *abfd, const char *note_section)
if (! arm_check_note (abfd, buffer, buffer_size, NOTE_ARCH_STRING, & arch_string))
goto FAIL;
- /* Check the architecture in the note against the architecture of the bfd. */
+ /* Check the architecture in the note against the architecture of the bfd.
+ Newer architectures versions should not be added here as build attribute
+ are a better mechanism to convey ISA used. */
switch (bfd_get_mach (abfd))
{
default:
@@ -369,6 +464,9 @@ static struct
const char * string;
unsigned int mach;
}
+
+/* Newer architectures versions should not be added here as build attribute are
+ a better mechanism to convey ISA used. */
architectures[] =
{
{ "armv2", bfd_mach_arm_2 },