Add support for the C_SKY series of processors.
authorAndrew Jenner <andrew@codesourcery.com>
Mon, 30 Jul 2018 11:24:14 +0000 (12:24 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 30 Jul 2018 11:24:14 +0000 (12:24 +0100)
commitb8891f8d622a31306062065813fc278d8a94fe21
tree4476440b69e1ce90b7e2b5a90d08f42563b43a7a
parent7d8a31665739412395f6dd370d2279acd322e78e
Add support for the C_SKY series of processors.

This patch series is a new binutils port for C-SKY processors, including support for both the V1 and V2 processor variants.  V1 is derived from the MCore architecture while V2 is substantially different, with mixed 16- and 32-bit instructions, a larger register set, a different (but overlapping) ABI, etc.  There is support for bare-metal ELF targets and Linux with both glibc and uClibc.

This code is being contributed jointly by C-SKY Microsystems and Mentor Graphics.  C-SKY is responsible for the technical content and has proposed Lifang Xia and Yunhai Shang as port maintainers.  (Note that C-SKY does have a corporate copyright assignment on file with the FSF.) Mentor Graphics' role has been cleaning up the code, adding documentation and additional test cases, etc, to address issues we anticipated reviewers would complain about.

bfd     * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add C-SKY.
        (BFD32_BACKENDS, BFD_BACKENDS_CFILES): Likewise.
        * Makefile.in: Regenerated.
        * archures.c (enum bfd_architecture): Add bfd_arch_csky and
        related bfd_mach defines.
        (bfd_csky_arch): Declare.
        (bfd_archures_list): Add C-SKY.
        * bfd-in.h (elf32_csky_build_stubs): Declare.
        (elf32_csky_size_stubs): Declare.
        (elf32_csky_next_input_section: Declare.
        (elf32_csky_setup_section_lists): Declare.
        * bfd-in2.h: Regenerated.
        * config.bfd: Add C-SKY.
        * configure.ac: Likewise.
        * configure: Regenerated.
        * cpu-csky.c: New file.
        * elf-bfd.h (enum elf_target_id): Add C-SKY.
        * elf32-csky.c: New file.
        * libbfd.h: Regenerated.
        * reloc.c: Add C-SKY relocations.
        * targets.c (csky_elf32_be_vec, csky_elf32_le_vec): Declare.
        (_bfd_target_vector): Add C-SKY target vector entries.

binutils* readelf.c: Include elf/csky.h.
        (guess_is_rela): Handle EM_CSKY.
        (dump_relocations): Likewise.
        (get_machine_name): Likewise.
        (is_32bit_abs_reloc): Likewise.

include  * dis-asm.h (csky_symbol_is_valid): Declare.
         * opcode/csky.h: New file.

opcodes  * Makefile.am (TARGET_LIBOPCODES_CFILES): Add csky-dis.c.
         * Makefile.in: Regenerated.
         * configure.ac: Add C-SKY.
         * configure: Regenerated.
         * csky-dis.c: New file.
         * csky-opc.h: New file.
         * disassemble.c (ARCH_csky): Define.
         (disassembler, disassemble_init_for_target): Add case for ARCH_csky.
         * disassemble.h (print_insn_csky, csky_get_disassembler): Declare.

gas      * Makefile.am (TARGET_CPU_CFILES): Add entry for C-SKY.
         (TARGET_CPU_HFILES, TARGET_ENV_HFILES): Likewise.
         * Makefile.in: Regenerated.
         * config/tc-csky.c: New file.
         * config/tc-csky.h: New file.
         * config/te-csky_abiv1.h: New file.
         * config/te-csky_abiv1_linux.h: New file.
         * config/te-csky_abiv2.h: New file.
         * config/te-csky_abiv2_linux.h: New file.
         * configure.tgt: Add C-SKY.
         * doc/Makefile.am (CPU_DOCS): Add entry for C-SKY.
         * doc/Makefile.in: Regenerated.
         * doc/all.texi: Set CSKY feature.
         * doc/as.texi (Overview): Add C-SKY options.
         (Machine Dependencies): Likewise.
         * doc/c-csky.texi: New file.
         * testsuite/gas/csky/*: New test cases.

ld      * Makefile.am (ALL_EMULATION_SOURCES): Add C-SKY emulations.
        (ecskyelf.c, ecskyelf_linux.c): New rules.
        * Makefile.in: Regenerated.
        * configure.tgt: Add C-SKY.
        * emulparams/cskyelf.sh: New file.
        * emulparams/cskyelf_linux.sh: New file.
        * emultempl/cskyelf.em: New file.
        * gen-doc.texi: Add C-SKY.
        * ld.texi: Likewise.
        (Options specific to C-SKY targets): New section.
        * testsuite/ld-csky/*: New tests.
162 files changed:
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/archures.c
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/config.bfd
bfd/configure
bfd/configure.ac
bfd/cpu-csky.c [new file with mode: 0644]
bfd/elf-bfd.h
bfd/elf32-csky.c [new file with mode: 0644]
bfd/libbfd.h
bfd/reloc.c
bfd/targets.c
binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/Makefile.am
gas/Makefile.in
gas/NEWS
gas/config/tc-csky.c [new file with mode: 0644]
gas/config/tc-csky.h [new file with mode: 0644]
gas/config/te-csky_abiv1.h [new file with mode: 0644]
gas/config/te-csky_abiv1_linux.h [new file with mode: 0644]
gas/config/te-csky_abiv2.h [new file with mode: 0644]
gas/config/te-csky_abiv2_linux.h [new file with mode: 0644]
gas/configure.tgt
gas/doc/Makefile.am
gas/doc/Makefile.in
gas/doc/all.texi
gas/doc/as.texi
gas/doc/c-csky.texi [new file with mode: 0644]
gas/testsuite/gas/csky/801_relax.d [new file with mode: 0644]
gas/testsuite/gas/csky/801_relax.s [new file with mode: 0644]
gas/testsuite/gas/csky/802j.d [new file with mode: 0644]
gas/testsuite/gas/csky/802j.s [new file with mode: 0644]
gas/testsuite/gas/csky/all.d [new file with mode: 0644]
gas/testsuite/gas/csky/all.s [new file with mode: 0644]
gas/testsuite/gas/csky/bsr1.d [new file with mode: 0644]
gas/testsuite/gas/csky/bsr1.s [new file with mode: 0644]
gas/testsuite/gas/csky/bsr2.d [new file with mode: 0644]
gas/testsuite/gas/csky/bsr2.s [new file with mode: 0644]
gas/testsuite/gas/csky/csky.exp [new file with mode: 0644]
gas/testsuite/gas/csky/csky_vdsp.d [new file with mode: 0644]
gas/testsuite/gas/csky/csky_vdsp.s [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_all.d [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_all.s [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_dsp.d [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_dsp.s [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_elrw.d [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_elrw.s [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_float.d [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_float.s [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_lrw.d [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_lrw.s [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_mnolrw1.d [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_mnolrw1.s [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_mnolrw2.d [new file with mode: 0644]
gas/testsuite/gas/csky/cskyv2_mnolrw2.s [new file with mode: 0644]
gas/testsuite/gas/csky/enhance_dsp.d [new file with mode: 0644]
gas/testsuite/gas/csky/enhance_dsp.s [new file with mode: 0644]
gas/testsuite/gas/csky/java.d [new file with mode: 0644]
gas/testsuite/gas/csky/java.s [new file with mode: 0644]
gas/testsuite/gas/csky/jbsr.d [new file with mode: 0644]
gas/testsuite/gas/csky/jbsr.s [new file with mode: 0644]
gas/testsuite/gas/csky/jbt.d [new file with mode: 0644]
gas/testsuite/gas/csky/jbt.s [new file with mode: 0644]
gas/testsuite/gas/csky/jbt_pic.d [new file with mode: 0644]
gas/testsuite/gas/csky/jbt_pic.s [new file with mode: 0644]
gas/testsuite/gas/csky/jmpi1.d [new file with mode: 0644]
gas/testsuite/gas/csky/jmpi1.s [new file with mode: 0644]
gas/testsuite/gas/csky/jmpi2.d [new file with mode: 0644]
gas/testsuite/gas/csky/jmpi2.s [new file with mode: 0644]
gas/testsuite/gas/csky/jmpi3.d [new file with mode: 0644]
gas/testsuite/gas/csky/jmpi3.s [new file with mode: 0644]
gas/testsuite/gas/csky/jmpiv2_1.d [new file with mode: 0644]
gas/testsuite/gas/csky/jmpiv2_1.s [new file with mode: 0644]
gas/testsuite/gas/csky/jmpiv2_2.d [new file with mode: 0644]
gas/testsuite/gas/csky/jmpiv2_2.s [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_1.d [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_1.s [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_2.d [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_2.s [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_3.d [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_3.s [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_4.d [new file with mode: 0644]
gas/testsuite/gas/csky/jsriv2_4.s [new file with mode: 0644]
gas/testsuite/gas/csky/trust.d [new file with mode: 0644]
gas/testsuite/gas/csky/trust.s [new file with mode: 0644]
gas/testsuite/gas/csky/v1_float.d [new file with mode: 0644]
gas/testsuite/gas/csky/v1_float.s [new file with mode: 0644]
gas/testsuite/gas/csky/v2_float_part1.d [new file with mode: 0644]
gas/testsuite/gas/csky/v2_float_part1.s [new file with mode: 0644]
gas/testsuite/gas/csky/v2_float_part2.d [new file with mode: 0644]
gas/testsuite/gas/csky/v2_float_part2.s [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_gd.d [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_gd.s [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_ie.d [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_ie.s [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_ld.d [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_ld.s [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_le.d [new file with mode: 0644]
gas/testsuite/gas/csky/v2_tls_le.s [new file with mode: 0644]
include/ChangeLog
include/dis-asm.h
include/elf/common.h
include/elf/csky.h [new file with mode: 0644]
include/opcode/csky.h [new file with mode: 0644]
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/NEWS
ld/configure.tgt
ld/emulparams/cskyelf.sh [new file with mode: 0644]
ld/emulparams/cskyelf_linux.sh [new file with mode: 0644]
ld/emultempl/cskyelf.em [new file with mode: 0644]
ld/gen-doc.texi
ld/ld.texi
ld/testsuite/ld-csky/csky.exp [new file with mode: 0644]
ld/testsuite/ld-csky/data.d [new file with mode: 0644]
ld/testsuite/ld-csky/data.s [new file with mode: 0644]
ld/testsuite/ld-csky/data_section.s [new file with mode: 0644]
ld/testsuite/ld-csky/emit-relocs-1.d [new file with mode: 0644]
ld/testsuite/ld-csky/emit-relocs-1.ld [new file with mode: 0644]
ld/testsuite/ld-csky/emit-relocs-1a.s [new file with mode: 0644]
ld/testsuite/ld-csky/emit-relocs-1b.s [new file with mode: 0644]
ld/testsuite/ld-csky/got.d [new file with mode: 0644]
ld/testsuite/ld-csky/got.s [new file with mode: 0644]
ld/testsuite/ld-csky/hilo16.d [new file with mode: 0644]
ld/testsuite/ld-csky/hilo16.s [new file with mode: 0644]
ld/testsuite/ld-csky/hilo16_symbol.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-gd-v1.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-gd-v1.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-gd.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-gd.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ie-v1.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ie-v1.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ie.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ie.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ld-v1.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ld-v1.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ld.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-ld.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-le-v1.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-le-v1.s [new file with mode: 0644]
ld/testsuite/ld-csky/tls-le.d [new file with mode: 0644]
ld/testsuite/ld-csky/tls-le.s [new file with mode: 0644]
ld/testsuite/ld-elf/merge.d
ld/testsuite/ld-elf/pr16496b.od
ld/testsuite/ld-elf/pr21884.d
ld/testsuite/ld-srec/srec.exp
ld/testsuite/ld-unique/pr21529.d
opcodes/ChangeLog
opcodes/Makefile.am
opcodes/Makefile.in
opcodes/configure
opcodes/configure.ac
opcodes/csky-dis.c [new file with mode: 0644]
opcodes/csky-opc.h [new file with mode: 0644]
opcodes/disassemble.c
opcodes/disassemble.h