diff options
author | Nick Clifton <nickc@redhat.com> | 2024-01-29 11:22:39 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2024-01-29 11:22:39 +0000 |
commit | e28726c4fd4e91570ec480c8323685b259e7cdac (patch) | |
tree | f9d9e7c30aa30ce707715877098bd1f795b03ec6 /gas | |
parent | 70d424aaf8ce0963e1ed9e929d13d404c90b926d (diff) | |
download | gdb-e28726c4fd4e91570ec480c8323685b259e7cdac.zip gdb-e28726c4fd4e91570ec480c8323685b259e7cdac.tar.gz gdb-e28726c4fd4e91570ec480c8323685b259e7cdac.tar.bz2 |
LoongArch: update test cases about TLS
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-loongarch.c | 19 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/macro_op.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/macro_op_32.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/macro_op_extreme_abs.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/tlsdesc_32.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/tlsdesc_32.s | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/tlsdesc_64.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/loongarch/tlsdesc_64.s | 2 |
8 files changed, 26 insertions, 7 deletions
diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index e0aff36..af4426b 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -724,8 +724,12 @@ loongarch_args_parser_can_match_arg_helper (char esc_ch1, char esc_ch2, } /* Only one register macros (used in normal code model) - emit R_LARCH_RELAX. */ + emit R_LARCH_RELAX. + LARCH_opts.ase_labs and LARCH_opts.ase_gabs are used + to generate the code model of absolute addresses, and + we do not relax this code model. */ if (LARCH_opts.relax && (ip->expand_from_macro & 1) + && ! (LARCH_opts.ase_labs | LARCH_opts.ase_gabs) && (BFD_RELOC_LARCH_PCALA_HI20 == reloc_type || BFD_RELOC_LARCH_PCALA_LO12 == reloc_type || BFD_RELOC_LARCH_GOT_PC_HI20 == reloc_type @@ -733,7 +737,11 @@ loongarch_args_parser_can_match_arg_helper (char esc_ch1, char esc_ch2, || BFD_RELOC_LARCH_TLS_LD_PC_HI20 == reloc_type || BFD_RELOC_LARCH_TLS_GD_PC_HI20 == reloc_type || BFD_RELOC_LARCH_TLS_DESC_PC_HI20 == reloc_type - || BFD_RELOC_LARCH_TLS_DESC_PC_LO12 == reloc_type)) + || BFD_RELOC_LARCH_TLS_DESC_PC_LO12 == reloc_type + || BFD_RELOC_LARCH_TLS_DESC_LD == reloc_type + || BFD_RELOC_LARCH_TLS_DESC_CALL == reloc_type + || BFD_RELOC_LARCH_TLS_IE_PC_HI20 == reloc_type + || BFD_RELOC_LARCH_TLS_IE_PC_LO12 == reloc_type)) { ip->reloc_info[ip->reloc_num].type = BFD_RELOC_LARCH_RELAX; ip->reloc_info[ip->reloc_num].value = const_0; @@ -1088,7 +1096,12 @@ append_fixp_and_insn (struct loongarch_cl_insn *ip) || BFD_RELOC_LARCH_TLS_LE_ADD_R == reloc_info[0].type || BFD_RELOC_LARCH_TLS_LD_PC_HI20 == reloc_info[0].type || BFD_RELOC_LARCH_TLS_GD_PC_HI20 == reloc_info[0].type - || BFD_RELOC_LARCH_TLS_DESC_PC_HI20 == reloc_info[0].type)) + || BFD_RELOC_LARCH_TLS_DESC_PC_HI20 == reloc_info[0].type + || BFD_RELOC_LARCH_TLS_DESC_PC_LO12 == reloc_info[0].type + || BFD_RELOC_LARCH_TLS_DESC_LD == reloc_info[0].type + || BFD_RELOC_LARCH_TLS_DESC_CALL == reloc_info[0].type + || BFD_RELOC_LARCH_TLS_IE_PC_HI20 == reloc_info[0].type + || BFD_RELOC_LARCH_TLS_IE_PC_LO12 == reloc_info[0].type)) { frag_wane (frag_now); frag_new (0); diff --git a/gas/testsuite/gas/loongarch/macro_op.d b/gas/testsuite/gas/loongarch/macro_op.d index 47f8f45..9d69643 100644 --- a/gas/testsuite/gas/loongarch/macro_op.d +++ b/gas/testsuite/gas/loongarch/macro_op.d @@ -57,8 +57,10 @@ Disassembly of section .text: 4c: R_LARCH_TLS_LE_LO12 TLS1 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..f8aaacd 100644 --- a/gas/testsuite/gas/loongarch/macro_op_32.d +++ b/gas/testsuite/gas/loongarch/macro_op_32.d @@ -53,8 +53,10 @@ Disassembly of section .text: 44: R_LARCH_TLS_LE_LO12 TLS1 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..6a81e82 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 diff --git a/gas/testsuite/gas/loongarch/tlsdesc_32.d b/gas/testsuite/gas/loongarch/tlsdesc_32.d index eddcc5e..6c9558d 100644 --- a/gas/testsuite/gas/loongarch/tlsdesc_32.d +++ b/gas/testsuite/gas/loongarch/tlsdesc_32.d @@ -23,5 +23,7 @@ Disassembly of section .text: 14: R_LARCH_RELAX \*ABS\* 18: 28800081 ld.w \$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\* diff --git a/gas/testsuite/gas/loongarch/tlsdesc_32.s b/gas/testsuite/gas/loongarch/tlsdesc_32.s index ef6aee9..19d768a 100644 --- a/gas/testsuite/gas/loongarch/tlsdesc_32.s +++ b/gas/testsuite/gas/loongarch/tlsdesc_32.s @@ -8,5 +8,5 @@ # R_LARCH_TLS_DESC_CALL var jirl $ra,$ra,%desc_call(var) - # test macro, pcalau12i + addi.w => pcaddi + # with R_LARCH_RELAX 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\* diff --git a/gas/testsuite/gas/loongarch/tlsdesc_64.s b/gas/testsuite/gas/loongarch/tlsdesc_64.s index 9d0ccb1..f515442 100644 --- a/gas/testsuite/gas/loongarch/tlsdesc_64.s +++ b/gas/testsuite/gas/loongarch/tlsdesc_64.s @@ -8,5 +8,5 @@ # R_LARCH_TLS_DESC_CALL var jirl $ra,$ra,%desc_call(var) - # test macro, pcalau12i + addi.d => pcaddi + # with R_LARCH_RELAX la.tls.desc $a0,var |