aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorCooper Qu <cooper.qu@linux.alibaba.com>2020-08-26 11:21:14 +0800
committerLifang Xia <lifang_xia@c-sky.com>2020-08-28 17:23:24 +0800
commit0861f561ebdd283e389c2c2fdb099bffadffecfa (patch)
treee5f13278de132426df58f2af728f1c7b747b790c /ld
parent6194b866b7a89969d8c66f8a97d40acc028373b1 (diff)
downloadfsf-binutils-gdb-0861f561ebdd283e389c2c2fdb099bffadffecfa.zip
fsf-binutils-gdb-0861f561ebdd283e389c2c2fdb099bffadffecfa.tar.gz
fsf-binutils-gdb-0861f561ebdd283e389c2c2fdb099bffadffecfa.tar.bz2
CSKY: Support attribute section.
bfd * elf32-csky.c (csky_archs): Fix arch names. (csky_find_arch_with_name): New. (elf32_csky_merge_attributes): New. (csky_elf_merge_private_bfd_data): Add process of merge attribute section. (elf32_csky_obj_attrs_arg_type): New. (elf32_csky_obj_attrs_handle_unknown): New. (elf_backend_obj_attrs_vendor): Define. (elf_backend_obj_attrs_section): Define. (elf_backend_obj_attrs_arg_type): Define. (elf_backend_obj_attrs_section_type): Define. binutils/ * readelf.c (get_csky_section_type_name): New. (get_section_type_name): Add handler for CSKY. (display_csky_attribute): New. (process_arch_specific): Add handler for CSKY. * testsuite/binutils-all/strip-3.d: Remove .csky.attributes section. elfcpp/ * elfcpp.h (enum SHT): New enum SHT_CSKY_ATTRIBUTES. gas/ * gas/config/tc-csky.c (md_begin): Set attributes. (isa_flag): Change type to unsigned 64 bits. (struct csky_cpu_info): Likewise. (struct csky_macro_info): Likewise. (set_csky_attribute): New. * testsuite/gas/csky/802j.d: Ignore .csky.attributes section. * testsuite/gas/csky/all.d: Likewise. * testsuite/gas/csky/bsr1.d: Likewise. * testsuite/gas/csky/csky_vdsp.d: Likewise. * testsuite/gas/csky/cskyv2_all.d: Likewise. * testsuite/gas/csky/cskyv2_ck803r2.d: Likewise. * testsuite/gas/csky/cskyv2_ck860.d: Likewise. * testsuite/gas/csky/cskyv2_dsp.d: Likewise. * testsuite/gas/csky/cskyv2_elrw.d: Likewise. * testsuite/gas/csky/cskyv2_float.d: Likewise. * testsuite/gas/csky/enhance_dsp.d: Likewise. * testsuite/gas/csky/java.d: Likewise. * testsuite/gas/csky/v1_float.d: Likewise. * testsuite/gas/csky/v2_float_part1.d: Likewise. * testsuite/gas/csky/v2_float_part2.d: Likewise. * testsuite/gas/csky/v2_tls_gd.d: Likewise. * testsuite/gas/csky/v2_tls_ie.d: Likewise. * testsuite/gas/csky/v2_tls_ld.d: Likewise. * testsuite/gas/csky/v2_tls_le.d: Likewise. * testsuite/gas/elf/elf.exp: Add handler for CSKY. * testsuite/gas/elf/section2.e-csky: New. include/ * elf/csky.h (SHT_CSKY_ATTRIBUTES): Define. (Tag_CSKY_ARCH_NAME): New enum constant. (Tag_CSKY_CPU_NAME): Likewise. (Tag_CSKY_ISA_FLAGS): Likewise. (Tag_CSKY_DSP_VERSION): Likewise. (Tag_CSKY_VDSP_VERSION): Likewise. (Tag_CSKY_FPU_VERSION): Likewise. (Tag_CSKY_FPU_ABI): Likewise. (Tag_CSKY_FPU_ROUNDING): Likewise. (Tag_CSKY_FPU_DENORMAL): Likewise. (Tag_CSKY_FPU_Exception): Likewise. (Tag_CSKY_FPU_NUMBER_MODULE): Likewise. (Tag_CSKY_FPU_HARDFP): Likewise. (Tag_CSKY_MAX): Likewise. (VAL_CSKY_DSP_VERSION_EXTENSION): Likewise. (VAL_CSKY_DSP_VERSION_2): Likewise. (VAL_CSKY_VDSP_VERSION_1): Likewise. (VAL_CSKY_VDSP_VERSION_2): Likewise. (VAL_CSKY_FPU_ABI_SOFT): Likewise. (VAL_CSKY_FPU_ABI_SOFTFP): Likewise. (VAL_CSKY_FPU_ABI_HARD): Likewise. (VAL_CSKY_FPU_HARDFP_HALF): Likewise. (VAL_CSKY_FPU_HARDFP_SINGLE): Likewise. (VAL_CSKY_FPU_HARDFP_DOUBLE): Likewise. * opcode/csky.h (CSKY_ISA_VDSP_V2): Define. CSKYV1_ISA_E1: Change to long constant type. CSKYV2_ISA_E1: Likewise. CSKYV2_ISA_1E2: Likewise. CSKYV2_ISA_2E3: Likewise. CSKYV2_ISA_3E7: Likewise. CSKYV2_ISA_7E10: Likewise. CSKYV2_ISA_3E3R1: Likewise. CSKYV2_ISA_3E3R2: Likewise. CSKYV2_ISA_10E60: Likewise. CSKY_ISA_TRUST: Likewise. CSKY_ISA_CACHE: Likewise. CSKY_ISA_NVIC: Likewise. CSKY_ISA_CP: Likewise. CSKY_ISA_MP: Likewise. CSKY_ISA_MP_1E2: Likewise. CSKY_ISA_JAVA: Likewise. CSKY_ISA_MAC: Likewise. CSKY_ISA_MAC_DSP: Likewise. CSKY_ISA_DSP: Likewise. CSKY_ISA_DSP_1E2: Likewise. CSKY_ISA_DSP_ENHANCE: Likewise. CSKY_ISA_FLOAT_E1: Likewise. CSKY_ISA_FLOAT_1E2: Likewise. CSKY_ISA_FLOAT_1E3: Likewise. CSKY_ISA_FLOAT_3E4: Likewise. CSKY_ISA_VDSP: Likewise. ld/ * emulparams/cskyelf.sh: Support attribute section. * testsuite/ld-csky/tls-le-v1.d: Match .csky.attributes section. * ld/testsuite/ld-csky/tls-le.d: Likewise. * testsuite/ld-elf/non-contiguous.ld: Ignore .csky.attributes section. opcodes/ * csky-dis.c (CSKY_DEFAULT_ISA): Define. (csky_dis_info): Add member isa. (csky_find_inst_info): Skip instructions that do not belong to current CPU. (csky_get_disassembler): Get infomation from attribute section. (print_insn_csky): Set defualt ISA flag. * csky.h (CSKY_ISA_VDSP_2): Rename from CSKY_ISA_VDSP_V2. * csky-opc.h (struct csky_opcode): Change isa_flag16 and isa_flag32'type to unsigned 64 bits.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/emulparams/cskyelf.sh1
-rw-r--r--ld/testsuite/ld-csky/tls-le-v1.d2
-rw-r--r--ld/testsuite/ld-csky/tls-le.d2
-rw-r--r--ld/testsuite/ld-elf/non-contiguous.ld1
5 files changed, 14 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 568e221..16274e8 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
+
+ * emulparams/cskyelf.sh: Support attribute section.
+ * testsuite/ld-csky/tls-le-v1.d: Match .csky.attributes section.
+ * ld/testsuite/ld-csky/tls-le.d: Likewise.
+ * testsuite/ld-elf/non-contiguous.ld: Ignore .csky.attributes
+ section.
+
2020-08-28 Nick Clifton <nickc@redhat.com>
PR 19011
diff --git a/ld/emulparams/cskyelf.sh b/ld/emulparams/cskyelf.sh
index d572ac8..b940c6c 100644
--- a/ld/emulparams/cskyelf.sh
+++ b/ld/emulparams/cskyelf.sh
@@ -10,6 +10,7 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEXT_START_ADDR=0x8000
CHECK_RELOCS_AFTER_OPEN_INPUT=yes
NONPAGED_TEXT_START_ADDR=0
+ATTRS_SECTIONS='.csky.attributes 0 : { KEEP (*(.csky.attributes)) KEEP (*(.csky.attributes)) }'
ARCH=csky
EMBEDDED=yes
EXTRA_EM_FILE=cskyelf
diff --git a/ld/testsuite/ld-csky/tls-le-v1.d b/ld/testsuite/ld-csky/tls-le-v1.d
index 034d5d9..d13c403 100644
--- a/ld/testsuite/ld-csky/tls-le-v1.d
+++ b/ld/testsuite/ld-csky/tls-le-v1.d
@@ -12,3 +12,5 @@ Idx Name Size VMA LMA File off Algn
.*
1 .tbss .*
.*
+ 2 .csky.attributes .*
+ .*
diff --git a/ld/testsuite/ld-csky/tls-le.d b/ld/testsuite/ld-csky/tls-le.d
index 8a0d90f..0a241b3 100644
--- a/ld/testsuite/ld-csky/tls-le.d
+++ b/ld/testsuite/ld-csky/tls-le.d
@@ -11,3 +11,5 @@ Idx Name Size VMA LMA File off Algn
.*
1 .tbss .*
.*
+ 2 .csky.attributes .*
+ .*
diff --git a/ld/testsuite/ld-elf/non-contiguous.ld b/ld/testsuite/ld-elf/non-contiguous.ld
index fc72253..cfd3f24 100644
--- a/ld/testsuite/ld-elf/non-contiguous.ld
+++ b/ld/testsuite/ld-elf/non-contiguous.ld
@@ -23,6 +23,7 @@ SECTIONS
*(.note.renesas)
*(.MIPS.abiflags)
*(.MSP430.attributes)
+ *(.csky.attributes)
*(.gnu.attributes)
}