aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
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 /gas/testsuite
parent6194b866b7a89969d8c66f8a97d40acc028373b1 (diff)
downloadgdb-0861f561ebdd283e389c2c2fdb099bffadffecfa.zip
gdb-0861f561ebdd283e389c2c2fdb099bffadffecfa.tar.gz
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 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/csky/802j.d1
-rw-r--r--gas/testsuite/gas/csky/all.d1
-rw-r--r--gas/testsuite/gas/csky/bsr1.d1
-rw-r--r--gas/testsuite/gas/csky/csky_vdsp.d1
-rw-r--r--gas/testsuite/gas/csky/cskyv2_all.d1
-rw-r--r--gas/testsuite/gas/csky/cskyv2_ck803r2.d1
-rw-r--r--gas/testsuite/gas/csky/cskyv2_ck860.d3
-rw-r--r--gas/testsuite/gas/csky/cskyv2_dsp.d3
-rw-r--r--gas/testsuite/gas/csky/cskyv2_elrw.d1
-rw-r--r--gas/testsuite/gas/csky/cskyv2_float.d1
-rw-r--r--gas/testsuite/gas/csky/enhance_dsp.d1
-rw-r--r--gas/testsuite/gas/csky/java.d1
-rw-r--r--gas/testsuite/gas/csky/v1_float.d1
-rw-r--r--gas/testsuite/gas/csky/v2_float_part1.d1
-rw-r--r--gas/testsuite/gas/csky/v2_float_part2.d1
-rw-r--r--gas/testsuite/gas/csky/v2_tls_gd.d1
-rw-r--r--gas/testsuite/gas/csky/v2_tls_ie.d1
-rw-r--r--gas/testsuite/gas/csky/v2_tls_ld.d1
-rw-r--r--gas/testsuite/gas/csky/v2_tls_le.d3
-rw-r--r--gas/testsuite/gas/elf/elf.exp3
-rw-r--r--gas/testsuite/gas/elf/section2.e-csky9
21 files changed, 34 insertions, 3 deletions
diff --git a/gas/testsuite/gas/csky/802j.d b/gas/testsuite/gas/csky/802j.d
index af7c857..c75666b 100644
--- a/gas/testsuite/gas/csky/802j.d
+++ b/gas/testsuite/gas/csky/802j.d
@@ -11,3 +11,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*1460\s*nie
\s*[0-9a-f]*:\s*1461\s*nir
\s*[0-9a-f]*:\s*3ae0\s*jmpix\s*r2,\s*16.*
+#...
diff --git a/gas/testsuite/gas/csky/all.d b/gas/testsuite/gas/csky/all.d
index c5da5b0..606bcc0 100644
--- a/gas/testsuite/gas/csky/all.d
+++ b/gas/testsuite/gas/csky/all.d
@@ -148,3 +148,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*1e37\s*or\s*r7, r7, r3
\s*[0-9a-f]*:\s*1715\s*xor\s*r5, r5, r1
\s*[0-9a-f]*:\s*1726\s*xor\s*r6, r6, r2
+#...
diff --git a/gas/testsuite/gas/csky/bsr1.d b/gas/testsuite/gas/csky/bsr1.d
index 91ba60d..69bef88 100644
--- a/gas/testsuite/gas/csky/bsr1.d
+++ b/gas/testsuite/gas/csky/bsr1.d
@@ -10,3 +10,4 @@ Disassembly of section \.text:
\s*[0-9a-f]:\s*f7fe\s*br\s*0x0\s*\/\/\s*0\s*\<lable*\>
\s*[0-9a-f]:\s*e7fd\s*bt\s*0x0\s*\/\/\s*0\s*\<lable*\>
\s*[0-9a-f]:\s*effc\s*bf\s*0x0\s*\/\/\s*0\s*\<lable*\>
+#...
diff --git a/gas/testsuite/gas/csky/csky_vdsp.d b/gas/testsuite/gas/csky/csky_vdsp.d
index 0e2eaa2..3af4413 100644
--- a/gas/testsuite/gas/csky/csky_vdsp.d
+++ b/gas/testsuite/gas/csky/csky_vdsp.d
@@ -362,3 +362,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*f8830fa2\s*vicl\.8\s*vr2,\s*vr3,\s*vr4
\s*[0-9a-f]*:\s*f8930fa2\s*vicl\.16\s*vr2,\s*vr3,\s*vr4
\s*[0-9a-f]*:\s*fa830fa2\s*vicl\.32\s*vr2,\s*vr3,\s*vr4
+#...
diff --git a/gas/testsuite/gas/csky/cskyv2_all.d b/gas/testsuite/gas/csky/cskyv2_all.d
index 5092690..bb688ec 100644
--- a/gas/testsuite/gas/csky/cskyv2_all.d
+++ b/gas/testsuite/gas/csky/cskyv2_all.d
@@ -323,3 +323,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*cc480000\s*lrs\.w\s*r2,\s*\[0x0\].*
\s*[0-9a-f]*:\s*ec430002\s*ori\s*r2,\s*r3,\s*2
\s*[0-9a-f]*:\s*ec43000a\s*ori\s*r2,\s*r3,\s*10
+#...
diff --git a/gas/testsuite/gas/csky/cskyv2_ck803r2.d b/gas/testsuite/gas/csky/cskyv2_ck803r2.d
index 298022a..8ef9e90 100644
--- a/gas/testsuite/gas/csky/cskyv2_ck803r2.d
+++ b/gas/testsuite/gas/csky/cskyv2_ck803r2.d
@@ -10,3 +10,4 @@ Disassembly of section \.text:
#...
\s*[0-9a-f]*:\s*6c03\s*mov\s*r0,\s*r0
\s*[0-9a-f]*:\s*e820fffd\s*bnezad\s*r0,\s*0.*
+#...
diff --git a/gas/testsuite/gas/csky/cskyv2_ck860.d b/gas/testsuite/gas/csky/cskyv2_ck860.d
index 2beb884..639bdbf 100644
--- a/gas/testsuite/gas/csky/cskyv2_ck860.d
+++ b/gas/testsuite/gas/csky/cskyv2_ck860.d
@@ -38,4 +38,5 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*c2000420\s*sync.s
\s*[0-9a-f]*:\s*c0000420\s*sync
\s*[0-9a-f]*:\s*d8437000\s*ldex.w\s*r2,\s*\(r3,\s*0x0\)
-\s*[0-9a-f]*:\s*dc437000\s*stex.w\s*r2,\s*\(r3,\s*0x0\) \ No newline at end of file
+\s*[0-9a-f]*:\s*dc437000\s*stex.w\s*r2,\s*\(r3,\s*0x0\)
+#...
diff --git a/gas/testsuite/gas/csky/cskyv2_dsp.d b/gas/testsuite/gas/csky/cskyv2_dsp.d
index f2e3d33..3bc52fe 100644
--- a/gas/testsuite/gas/csky/cskyv2_dsp.d
+++ b/gas/testsuite/gas/csky/cskyv2_dsp.d
@@ -1,4 +1,4 @@
-# name: csky - all
+# name: csky - dsp
#as: -mcpu=ck810e -W
#objdump: -D
@@ -16,3 +16,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*c4319080\s*mulshs\s*r17,\s*r1
\s*[0-9a-f]*:\s*c6ec9440\s*mulswa\s*r12,\s*r23
\s*[0-9a-f]*:\s*c4a39480\s*mulsws\s*r3,\s*r5
+#...
diff --git a/gas/testsuite/gas/csky/cskyv2_elrw.d b/gas/testsuite/gas/csky/cskyv2_elrw.d
index 5a52d5a..d0acefb 100644
--- a/gas/testsuite/gas/csky/cskyv2_elrw.d
+++ b/gas/testsuite/gas/csky/cskyv2_elrw.d
@@ -8,3 +8,4 @@
#...
\s*[0-9a-f]*:\s*c0004020\s*rte
\s*[0-9a-f]*:\s*00001234\s*\.long\s*0x00001234
+#...
diff --git a/gas/testsuite/gas/csky/cskyv2_float.d b/gas/testsuite/gas/csky/cskyv2_float.d
index f1039c9..b1ed9cb 100644
--- a/gas/testsuite/gas/csky/cskyv2_float.d
+++ b/gas/testsuite/gas/csky/cskyv2_float.d
@@ -57,3 +57,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*f4041aab\s*fuitod\s*fr11,\s*fr4
\s*[0-9a-f]*:\s*f4081ac2\s*fdtos\s*fr2,\s*fr8
\s*[0-9a-f]*:\s*f40b1ae5\s*fstod\s*fr5,\s*fr11
+#...
diff --git a/gas/testsuite/gas/csky/enhance_dsp.d b/gas/testsuite/gas/csky/enhance_dsp.d
index 96d26ab..17b33ea 100644
--- a/gas/testsuite/gas/csky/enhance_dsp.d
+++ b/gas/testsuite/gas/csky/enhance_dsp.d
@@ -216,3 +216,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*f8838ce2\s*mulsca\.s16\.e\s*r2,\s*r3,\s*r4
\s*[0-9a-f]*:\s*f8838ce2\s*mulsca\.s16\.e\s*r2,\s*r3,\s*r4
\s*[0-9a-f]*:\s*f8838442\s*mula\.32\.l\s*r2,\s*r3,\s*r4
+#...
diff --git a/gas/testsuite/gas/csky/java.d b/gas/testsuite/gas/csky/java.d
index f433d52..c0791bf 100644
--- a/gas/testsuite/gas/csky/java.d
+++ b/gas/testsuite/gas/csky/java.d
@@ -10,3 +10,4 @@ Disassembly of section \.text:
\s*[0-9a-f]:\s*14ae\s*bpop\.w\s*r3
\s*[0-9a-f]:\s*14ec\s*bpush\.h\s*r3
\s*[0-9a-f]:\s*14ee\s*bpush\.w\s*r3
+#...
diff --git a/gas/testsuite/gas/csky/v1_float.d b/gas/testsuite/gas/csky/v1_float.d
index 995a77d..4c08897 100644
--- a/gas/testsuite/gas/csky/v1_float.d
+++ b/gas/testsuite/gas/csky/v1_float.d
@@ -220,3 +220,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*ffe08002\s*\.long\s*0xffe08002
\s*[0-9a-f]*:\s*ffe20002\s*\.long\s*0xffe20002
\s*[0-9a-f]*:\s*ffe18002\s*\.long\s*0xffe18002
+#...
diff --git a/gas/testsuite/gas/csky/v2_float_part1.d b/gas/testsuite/gas/csky/v2_float_part1.d
index aa0b0a4..c3f5d56 100644
--- a/gas/testsuite/gas/csky/v2_float_part1.d
+++ b/gas/testsuite/gas/csky/v2_float_part1.d
@@ -52,3 +52,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*f4830202\s*fmuls\s*fr2,\s*fr3,\s*fr4
\s*[0-9a-f]*:\s*f4830022\s*fsubs\s*fr2,\s*fr3,\s*fr4
\s*[0-9a-f]*:\s*f4830002\s*fadds\s*fr2,\s*fr3,\s*fr4
+#...
diff --git a/gas/testsuite/gas/csky/v2_float_part2.d b/gas/testsuite/gas/csky/v2_float_part2.d
index 94b04e0..78fa37b 100644
--- a/gas/testsuite/gas/csky/v2_float_part2.d
+++ b/gas/testsuite/gas/csky/v2_float_part2.d
@@ -18,3 +18,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*4048f5c3\s*\.long\s*0x4048f5c3
\s*[0-9a-f]*:\s*51eb851f\s*\.long\s*0x51eb851f
\s*[0-9a-f]*:\s*40091eb8\s*\.long\s*0x40091eb8
+#...
diff --git a/gas/testsuite/gas/csky/v2_tls_gd.d b/gas/testsuite/gas/csky/v2_tls_gd.d
index 226beaa..6680d6e 100644
--- a/gas/testsuite/gas/csky/v2_tls_gd.d
+++ b/gas/testsuite/gas/csky/v2_tls_gd.d
@@ -8,3 +8,4 @@ Disassembly of section \.text:
#...
\s*[0-9a-f]*:\s*R_CKCORE_TLS_GD32\s*xxx.*
\s*[0-9a-f]*:\s*R_CKCORE_PLT32\s*__tls_get_addr
+#...
diff --git a/gas/testsuite/gas/csky/v2_tls_ie.d b/gas/testsuite/gas/csky/v2_tls_ie.d
index db77387..d55d1ce 100644
--- a/gas/testsuite/gas/csky/v2_tls_ie.d
+++ b/gas/testsuite/gas/csky/v2_tls_ie.d
@@ -7,3 +7,4 @@
Disassembly of section \.text:
#...
\s*[0-9a-f]*:\s*R_CKCORE_TLS_IE32\s*xxx.*
+#...
diff --git a/gas/testsuite/gas/csky/v2_tls_ld.d b/gas/testsuite/gas/csky/v2_tls_ld.d
index 9f12ace..4843a41 100644
--- a/gas/testsuite/gas/csky/v2_tls_ld.d
+++ b/gas/testsuite/gas/csky/v2_tls_ld.d
@@ -9,3 +9,4 @@ Disassembly of section \.text:
\s*[0-9a-f]*:\s*R_CKCORE_TLS_LDM32\s*xxx.*
\s*[0-9a-f]*:\s*R_CKCORE_PLT32\s*__tls_get_addr
\s*[0-9a-f]*:\s*R_CKCORE_TLS_LDO32\s*xxx
+#...
diff --git a/gas/testsuite/gas/csky/v2_tls_le.d b/gas/testsuite/gas/csky/v2_tls_le.d
index c34d6d7..e4ab536 100644
--- a/gas/testsuite/gas/csky/v2_tls_le.d
+++ b/gas/testsuite/gas/csky/v2_tls_le.d
@@ -1,4 +1,4 @@
-# name: csky - v2 TLS IE
+# name: csky - v2 TLS LE
#as: -mcpu=ck810 -W
#objdump: -Dr
@@ -7,3 +7,4 @@
Disassembly of section \.text:
#...
\s*[0-9a-f]*:\s*R_CKCORE_TLS_LE32\s*xxx
+#...
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index 2f9893b..8520421 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -65,6 +65,9 @@ if { [is_elf_format] } then {
if {[istarget "avr*-*-*"]} {
set dump_opts {{as -mno-link-relax}}
}
+ if {[istarget "csky*-*-*"]} {
+ set target_machine -csky
+ }
if {[istarget "m32r*-*-*"]} then {
set target_machine -m32r
}
diff --git a/gas/testsuite/gas/elf/section2.e-csky b/gas/testsuite/gas/elf/section2.e-csky
new file mode 100644
index 0000000..115bae2
--- /dev/null
+++ b/gas/testsuite/gas/elf/section2.e-csky
@@ -0,0 +1,9 @@
+
+Symbol table '.symtab' contains 6 entries:
+ +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
+ +0: 0+0 +0 +NOTYPE +LOCAL +DEFAULT +UND
+ +1: 0+0 +0 +SECTION +LOCAL +DEFAULT +1
+ +2: 0+0 +0 +SECTION +LOCAL +DEFAULT +2
+ +3: 0+0 +0 +SECTION +LOCAL +DEFAULT +3
+ +4: 0+0 +0 +SECTION +LOCAL +DEFAULT +4
+ +5: 0+0 +0 +SECTION +LOCAL +DEFAULT +5