diff options
author | Lulu Cai <cailulu@loongson.cn> | 2024-01-25 19:20:00 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2024-03-06 14:47:03 +0800 |
commit | a9859f5ad0ed35ffd937c4900957f54e4893a35b (patch) | |
tree | c26f5e24ac28abea62900d3e3f0bc3827335f799 /gas | |
parent | d5de762be734940049f1fc77d7b7bad2ee5f06f7 (diff) | |
download | gdb-a9859f5ad0ed35ffd937c4900957f54e4893a35b.zip gdb-a9859f5ad0ed35ffd937c4900957f54e4893a35b.tar.gz gdb-a9859f5ad0ed35ffd937c4900957f54e4893a35b.tar.bz2 |
LoongArch: Fix some test cases for TLS transition and relax
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/gas/loongarch/macro_op.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/macro_op_32.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/macro_op_extreme_abs.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/macro_op_extreme_pc.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.d | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.s | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/reloc.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/tlsdesc_32.d | 27 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/tlsdesc_32.s | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/tlsdesc_64.d | 2 |
10 files changed, 41 insertions, 46 deletions
diff --git a/gas/testsuite/gas/loongarch/macro_op.d b/gas/testsuite/gas/loongarch/macro_op.d index 47f8f45..106f619 100644 --- a/gas/testsuite/gas/loongarch/macro_op.d +++ b/gas/testsuite/gas/loongarch/macro_op.d @@ -53,12 +53,16 @@ Disassembly of section .text: 44: R_LARCH_RELAX \*ABS\* 48: 14000004 lu12i.w \$a0, 0 48: R_LARCH_TLS_LE_HI20 TLS1 + 48: R_LARCH_RELAX \*ABS\* 4c: 03800084 ori \$a0, \$a0, 0x0 4c: R_LARCH_TLS_LE_LO12 TLS1 + 4c: R_LARCH_RELAX \*ABS\* 50: 1a000004 pcalau12i \$a0, 0 50: R_LARCH_TLS_IE_PC_HI20 TLS1 + 50: R_LARCH_RELAX \*ABS\* 54: 28c00084 ld.d \$a0, \$a0, 0 54: R_LARCH_TLS_IE_PC_LO12 TLS1 + 54: R_LARCH_RELAX \*ABS\* 58: 1a000004 pcalau12i \$a0, 0 58: R_LARCH_TLS_LD_PC_HI20 TLS1 58: R_LARCH_RELAX \*ABS\* diff --git a/gas/testsuite/gas/loongarch/macro_op_32.d b/gas/testsuite/gas/loongarch/macro_op_32.d index a7349aa..8fd6992 100644 --- a/gas/testsuite/gas/loongarch/macro_op_32.d +++ b/gas/testsuite/gas/loongarch/macro_op_32.d @@ -49,12 +49,16 @@ Disassembly of section .text: 3c: R_LARCH_RELAX \*ABS\* 40: 14000004 lu12i.w \$a0, 0 40: R_LARCH_TLS_LE_HI20 TLS1 + 40: R_LARCH_RELAX \*ABS\* 44: 03800084 ori \$a0, \$a0, 0x0 44: R_LARCH_TLS_LE_LO12 TLS1 + 44: R_LARCH_RELAX \*ABS\* 48: 1a000004 pcalau12i \$a0, 0 48: R_LARCH_TLS_IE_PC_HI20 TLS1 + 48: R_LARCH_RELAX \*ABS\* 4c: 28800084 ld.w \$a0, \$a0, 0 4c: R_LARCH_TLS_IE_PC_LO12 TLS1 + 4c: R_LARCH_RELAX \*ABS\* 50: 1a000004 pcalau12i \$a0, 0 50: R_LARCH_TLS_LD_PC_HI20 TLS1 50: R_LARCH_RELAX \*ABS\* diff --git a/gas/testsuite/gas/loongarch/macro_op_extreme_abs.d b/gas/testsuite/gas/loongarch/macro_op_extreme_abs.d index 5c823ba..8e3a2aa 100644 --- a/gas/testsuite/gas/loongarch/macro_op_extreme_abs.d +++ b/gas/testsuite/gas/loongarch/macro_op_extreme_abs.d @@ -28,10 +28,8 @@ Disassembly of section .text: 1c: R_LARCH_ABS64_HI12 .L1 20: 1a000004 pcalau12i \$a0, 0 20: R_LARCH_PCALA_HI20 .L1 - 20: R_LARCH_RELAX \*ABS\* 24: 02c00084 addi.d \$a0, \$a0, 0 24: R_LARCH_PCALA_LO12 .L1 - 24: R_LARCH_RELAX \*ABS\* 28: 14000004 lu12i.w \$a0, 0 28: R_LARCH_GOT_HI20 .L1 2c: 03800084 ori \$a0, \$a0, 0x0 @@ -43,8 +41,10 @@ Disassembly of section .text: 38: 28c00084 ld.d \$a0, \$a0, 0 3c: 14000004 lu12i.w \$a0, 0 3c: R_LARCH_TLS_LE_HI20 TLS1 + 3c: R_LARCH_RELAX \*ABS\* 40: 03800084 ori \$a0, \$a0, 0x0 40: R_LARCH_TLS_LE_LO12 TLS1 + 40: R_LARCH_RELAX \*ABS\* 44: 14000004 lu12i.w \$a0, 0 44: R_LARCH_TLS_IE_HI20 TLS1 48: 03800084 ori \$a0, \$a0, 0x0 diff --git a/gas/testsuite/gas/loongarch/macro_op_extreme_pc.d b/gas/testsuite/gas/loongarch/macro_op_extreme_pc.d index 68fbb33..21c5e5a 100644 --- a/gas/testsuite/gas/loongarch/macro_op_extreme_pc.d +++ b/gas/testsuite/gas/loongarch/macro_op_extreme_pc.d @@ -46,8 +46,10 @@ Disassembly of section .text: [ ]+4c:[ ]+380c1484[ ]+ldx.d[ ]+\$a0, \$a0, \$a1 [ ]+50:[ ]+14000004[ ]+lu12i.w[ ]+\$a0, 0 [ ]+50: R_LARCH_TLS_LE_HI20[ ]+TLS1 +[ ]+50: R_LARCH_RELAX[ ]+\*ABS\* [ ]+54:[ ]+03800084[ ]+ori[ ]+\$a0, \$a0, 0x0 [ ]+54: R_LARCH_TLS_LE_LO12[ ]+TLS1 +[ ]+54: R_LARCH_RELAX[ ]+\*ABS\* [ ]+58:[ ]+1a000004[ ]+pcalau12i[ ]+\$a0, 0 [ ]+58: R_LARCH_TLS_IE_PC_HI20[ ]+TLS1 [ ]+5c:[ ]+02c00005[ ]+li.d[ ]+\$a1, 0 diff --git a/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.d b/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.d index 367039e..6b164cf 100644 --- a/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.d +++ b/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.d @@ -14,7 +14,7 @@ Disassembly of section .eh_frame: [ ]+c:[ ]+01017c01[ ]+fadd.d[ ]+\$fa1, \$fa0, \$fs7 [ ]+10:[ ]+0c030d1b[ ]+.word[ ]+[ ]+0x0c030d1b [ ]+14:[ ]+00000016[ ]+.word[ ]+[ ]+0x00000016 -[ ]+18:[ ]+00000034[ ]+.word[ ]+[ ]+0x00000034 +[ ]+18:[ ]+0000003c[ ]+.word[ ]+[ ]+0x0000003c [ ]+1c:[ ]+0000001c[ ]+.word[ ]+[ ]+0x0000001c [ ]+... [ ]+20: R_LARCH_32_PCREL[ ]+L0\^A @@ -26,7 +26,7 @@ Disassembly of section .eh_frame: [ ]+2c:[ ]+d6400016[ ]+.word[ ]+[ ]+0xd6400016 [ ]+2e: R_LARCH_ADD6[ ]+L0\^A [ ]+2e: R_LARCH_SUB6[ ]+L0\^A -[ ]+30:[ ]+4000160c[ ]+beqz[ ]+\$t4, 3145748[ ]+# 300044 <L0\^A\+0x30000c> +[ ]+30:[ ]+4000160c[ ]+beqz[ ]+\$t4, 3145748[ ]+# 300044 <L0\^A\+0x2ffffc> [ ]+33: R_LARCH_ADD6[ ]+L0\^A [ ]+33: R_LARCH_SUB6[ ]+L0\^A [ ]+34:[ ]+00160cd6[ ]+orn[ ]+\$fp, \$a2, \$sp @@ -39,8 +39,14 @@ Disassembly of section .eh_frame: [ ]+40:[ ]+d6400016[ ]+.word[ ]+[ ]+0xd6400016 [ ]+42: R_LARCH_ADD6[ ]+L0\^A [ ]+42: R_LARCH_SUB6[ ]+L0\^A -[ ]+44:[ ]+4000160c[ ]+beqz[ ]+\$t4, 3145748[ ]+# 300058 <L0\^A\+0x300020> +[ ]+44:[ ]+4000160c[ ]+beqz[ ]+\$t4, 3145748[ ]+# 300058 <L0\^A\+0x300010> [ ]+47: R_LARCH_ADD6[ ]+L0\^A [ ]+47: R_LARCH_SUB6[ ]+L0\^A -[ ]+48:[ ]+000000d6[ ]+.word[ ]+[ ]+0x000000d6 -[ ]+4c:[ ]+00000000[ ]+.word[ ]+[ ]+0x00000000 +[ ]+48:[ ]+00160cd6[ ]+orn[ ]+\$fp, \$a2, \$sp +[ ]+4c:[ ]+160cd640[ ]+lu32i.d[ ]+\$zero, 26290 +[ ]+4c: R_LARCH_ADD6[ ]+L0\^A +[ ]+4c: R_LARCH_SUB6[ ]+L0\^A +[ ]+50:[ ]+00d64000[ ]+bstrpick.d[ ]+\$zero, \$zero, 0x16, 0x10 +[ ]+51: R_LARCH_ADD6[ ]+L0\^A +[ ]+51: R_LARCH_SUB6[ ]+L0\^A +[ ]+54:[ ]+00000000[ ]+.word[ ]+[ ]+0x00000000 diff --git a/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.s b/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.s index 6e4c9b8..2c67587 100644 --- a/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.s +++ b/gas/testsuite/gas/loongarch/relax-cfi-fde-DW_CFA_advance_loc.s @@ -30,4 +30,12 @@ pcalau12i $t0, %le_hi20_r(a) add.d $t0, $tp, $t0, %le_add_r(a) .cfi_restore 22 +.cfi_def_cfa 22, 0 +la.tls.ie $t0, a +.cfi_restore 22 + +.cfi_def_cfa 22, 0 +la.tls.le $t0, a +.cfi_restore 22 + .cfi_endproc diff --git a/gas/testsuite/gas/loongarch/reloc.d b/gas/testsuite/gas/loongarch/reloc.d index fa249c5..6a8f0e1 100644 ---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 ]+130:[ ]+R_LARCH_TLS_LE_LO12[ ]+TLSL1\+0x8 +[ ]+130:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+134:[ ]+16000004[ ]+lu32i.d[ ]+\$a0,[ ]+0 [ ]+134:[ ]+R_LARCH_TLS_LE64_LO20[ ]+TLSL1\+0x8 +[ ]+134:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+138:[ ]+03000085[ ]+lu52i.d[ ]+\$a1,[ ]+\$a0,[ ]+0 [ ]+138:[ ]+R_LARCH_TLS_LE64_HI12[ ]+TLSL1\+0x8 +[ ]+138:[ ]+R_LARCH_RELAX[ ]+\*ABS\* [ ]+13c:[ ]+14000004[ ]+lu12i.w[ ]+\$a0,[ ]+0 [ ]+13c:[ ]+R_LARCH_TLS_LE_HI20_R[ ]+TLSL1 [ ]+13c:[ ]+R_LARCH_RELAX[ ]+\*ABS\* diff --git a/gas/testsuite/gas/loongarch/tlsdesc_32.d b/gas/testsuite/gas/loongarch/tlsdesc_32.d deleted file mode 100644 index eddcc5e..0000000 --- a/gas/testsuite/gas/loongarch/tlsdesc_32.d +++ /dev/null @@ -1,27 +0,0 @@ -#as: -#objdump: -dr -#skip: loongarch64-*-* - -.*:[ ]+file format .* - -Disassembly of section .text: - -0+ <.*>: - 0: 1a000004 pcalau12i \$a0, 0 - 0: R_LARCH_TLS_DESC_PC_HI20 var - 4: 02800084 addi.w \$a0, \$a0, 0 - 4: R_LARCH_TLS_DESC_PC_LO12 var - 8: 28800081 ld.w \$ra, \$a0, 0 - 8: R_LARCH_TLS_DESC_LD var - c: 4c000021 jirl \$ra, \$ra, 0 - c: R_LARCH_TLS_DESC_CALL var - 10: 1a000004 pcalau12i \$a0, 0 - 10: R_LARCH_TLS_DESC_PC_HI20 var - 10: R_LARCH_RELAX \*ABS\* - 14: 02800084 addi.w \$a0, \$a0, 0 - 14: R_LARCH_TLS_DESC_PC_LO12 var - 14: R_LARCH_RELAX \*ABS\* - 18: 28800081 ld.w \$ra, \$a0, 0 - 18: R_LARCH_TLS_DESC_LD var - 1c: 4c000021 jirl \$ra, \$ra, 0 - 1c: R_LARCH_TLS_DESC_CALL var diff --git a/gas/testsuite/gas/loongarch/tlsdesc_32.s b/gas/testsuite/gas/loongarch/tlsdesc_32.s deleted file mode 100644 index 2a139c0..0000000 --- a/gas/testsuite/gas/loongarch/tlsdesc_32.s +++ /dev/null @@ -1,12 +0,0 @@ -.L1: - # R_LARCH_TLS_DESC_PC_HI20 var - pcalau12i $a0,%desc_pc_hi20(var) - # R_LARCH_TLS_DESC_PC_LO12 var - addi.w $a0,$a0,%desc_pc_lo12(var) - # R_LARCH_TLS_DESC_LD var - ld.w $ra,$a0,%desc_ld(var) - # R_LARCH_TLS_DESC_CALL var - jirl $ra,$ra,%desc_call(var) - - # test macro, pcalau12i + addi.w => pcaddi - la.tls.desc $a0,var diff --git a/gas/testsuite/gas/loongarch/tlsdesc_64.d b/gas/testsuite/gas/loongarch/tlsdesc_64.d index 2a2829c..8fc9e88 100644 --- a/gas/testsuite/gas/loongarch/tlsdesc_64.d +++ b/gas/testsuite/gas/loongarch/tlsdesc_64.d @@ -24,5 +24,7 @@ Disassembly of section .text: 14: R_LARCH_RELAX \*ABS\* 18: 28c00081 ld.d \$ra, \$a0, 0 18: R_LARCH_TLS_DESC_LD var + 18: R_LARCH_RELAX \*ABS\* 1c: 4c000021 jirl \$ra, \$ra, 0 1c: R_LARCH_TLS_DESC_CALL var + 1c: R_LARCH_RELAX \*ABS\* |