From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id B7E5B385AC12 for ; Fri, 8 Mar 2024 08:31:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B7E5B385AC12 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B7E5B385AC12 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709886711; cv=none; b=o6d8DaPm3IgHNVfVQiPFDYWl+3rD7xaWiQ3x4MZKvaBOfhpAM0sFPR/CeRheCwH4rqQ1s+Ce29L5+orOFrzqPLeze+V4Uk3klZsSWsjZcoL7skOTOVhaspwUqjxZMAY/LQ5/lw7iTgL3KFzR/V9DJ8hwpmpvK8PD3T7TdCx8pPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709886711; c=relaxed/simple; bh=9lC92ZlCAa/wKWAp4oGLyFo4bzoP5DxJkaKU5iE7d5k=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Nc9xH6bouKJS8GQgOjQXhZFnjlxQLApk2SsmbM6MPMug7DKUyoJC3OcTIdKtxxaHYOoyxaAKNcNIU5pnOGItgju0ETsODEzA7gr80QZmGq/EzLqXofbehtP5v5C8353RkA2xJfgrwBUbyBd56JxEoz5eTkHinJircZ3Dfh9uIGI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.2.6.5]) by gateway (Coremail) with SMTP id _____8DxK+nyzOplojkWAA--.36557S3; Fri, 08 Mar 2024 16:31:46 +0800 (CST) Received: from 5.5.5 (unknown [10.2.6.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxfRPxzOplsihRAA--.52037S4; Fri, 08 Mar 2024 16:31:46 +0800 (CST) From: Lulu Cai To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, liuzhensong@loongson.cn, mengqinggang@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn, wanglei@loongson.cn, hejinyang@loongson.cn, Lulu Cai Subject: [PATCH v1] LoongArch: Fix gas and ld test cases Date: Fri, 8 Mar 2024 16:31:43 +0800 Message-Id: <20240308083143.3769690-1-cailulu@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8DxfRPxzOplsihRAA--.52037S4 X-CM-SenderInfo: xfdlz3tox6z05rqj20fqof0/1tbiAQAKB2XpeuYQOAACs2 X-Coremail-Antispam: 1Uk129KBj93XoW3GFykAr18ur1xGF1DAF4xAFc_yoW7CF1Dpr 9rZrySkFW8CFnrWFyDC3y5Xw1kWwn7Gry7Wa4fta4I9rs5JrWxZw1IyrZxXF45Xw4jv34S v340q345uFWDtwbCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07URa0PUUUUU= X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * After adding the old LE relax, all old LE relocations will have an R_LARCH_RELAX relocation. Fix the gas test case failure caused by the implementation of the old LE relax. * loongarch64-elf does not support pie and -z norelro options, removed in test files. --- gas/testsuite/gas/loongarch/relocs_32.d | 2 ++ gas/testsuite/gas/loongarch/relocs_64.d | 4 ++++ ld/testsuite/ld-loongarch-elf/desc-le-norelax.d | 2 +- ld/testsuite/ld-loongarch-elf/desc-le-relax.d | 2 +- ld/testsuite/ld-loongarch-elf/ie-le-norelax.d | 2 +- ld/testsuite/ld-loongarch-elf/ie-le-relax.d | 2 +- ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp | 5 ++++- ld/testsuite/ld-loongarch-elf/macro_op_32.d | 4 ++++ 8 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gas/testsuite/gas/loongarch/relocs_32.d b/gas/testsuite/gas/loongarch/relocs_32.d index 3e1bb62e263..96ef2800a51 100644 --- a/gas/testsuite/gas/loongarch/relocs_32.d +++ b/gas/testsuite/gas/loongarch/relocs_32.d @@ -30,8 +30,10 @@ Disassembly of section .text: 24: R_LARCH_GOT_LO12 .L1 28: 14000004 lu12i.w \$a0, 0 28: R_LARCH_TLS_LE_HI20 TLSL1 + 28: R_LARCH_RELAX \*ABS\* 2c: 03800085 ori \$a1, \$a0, 0x0 2c: R_LARCH_TLS_LE_LO12 TLSL1 + 2c: R_LARCH_RELAX \*ABS\* 30: 1a000004 pcalau12i \$a0, 0 30: R_LARCH_TLS_IE_PC_HI20 TLSL1 34: 02c00005 li.d \$a1, 0 diff --git a/gas/testsuite/gas/loongarch/relocs_64.d b/gas/testsuite/gas/loongarch/relocs_64.d index 631137eb174..35dde02f7fc 100644 --- a/gas/testsuite/gas/loongarch/relocs_64.d +++ b/gas/testsuite/gas/loongarch/relocs_64.d @@ -48,12 +48,16 @@ Disassembly of section .text: 48: R_LARCH_GOT64_HI12 .L1 4c: 14000004 lu12i.w \$a0, 0 4c: R_LARCH_TLS_LE_HI20 TLSL1 + 4c: R_LARCH_RELAX \*ABS\* 50: 03800085 ori \$a1, \$a0, 0x0 50: R_LARCH_TLS_LE_LO12 TLSL1 + 50: R_LARCH_RELAX \*ABS\* 54: 16000004 lu32i.d \$a0, 0 54: R_LARCH_TLS_LE64_LO20 TLSL1 + 54: R_LARCH_RELAX \*ABS\* 58: 03000085 lu52i.d \$a1, \$a0, 0 58: R_LARCH_TLS_LE64_HI12 TLSL1 + 58: R_LARCH_RELAX \*ABS\* 5c: 1a000004 pcalau12i \$a0, 0 5c: R_LARCH_TLS_IE_PC_HI20 TLSL1 60: 02c00005 li.d \$a1, 0 diff --git a/ld/testsuite/ld-loongarch-elf/desc-le-norelax.d b/ld/testsuite/ld-loongarch-elf/desc-le-norelax.d index 5a53245ad7f..43749f1b819 100644 --- a/ld/testsuite/ld-loongarch-elf/desc-le-norelax.d +++ b/ld/testsuite/ld-loongarch-elf/desc-le-norelax.d @@ -1,5 +1,5 @@ #as: -#ld: -z norelro -e0 --no-relax +#ld: -e0 --no-relax #objdump: -dr #skip: loongarch32-*-* diff --git a/ld/testsuite/ld-loongarch-elf/desc-le-relax.d b/ld/testsuite/ld-loongarch-elf/desc-le-relax.d index 03b5535edf8..71a540fda30 100644 --- a/ld/testsuite/ld-loongarch-elf/desc-le-relax.d +++ b/ld/testsuite/ld-loongarch-elf/desc-le-relax.d @@ -1,5 +1,5 @@ #as: -#ld: -z norelro -e0 +#ld: -e0 #objdump: -dr -M no-aliases #skip: loongarch32-*-* diff --git a/ld/testsuite/ld-loongarch-elf/ie-le-norelax.d b/ld/testsuite/ld-loongarch-elf/ie-le-norelax.d index 81d78ca3245..0221b495d68 100644 --- a/ld/testsuite/ld-loongarch-elf/ie-le-norelax.d +++ b/ld/testsuite/ld-loongarch-elf/ie-le-norelax.d @@ -1,5 +1,5 @@ #as: -#ld: -z norelro -e0 --no-relax +#ld: -e0 --no-relax #objdump: -dr #skip: loongarch32-*-* diff --git a/ld/testsuite/ld-loongarch-elf/ie-le-relax.d b/ld/testsuite/ld-loongarch-elf/ie-le-relax.d index 03b5535edf8..71a540fda30 100644 --- a/ld/testsuite/ld-loongarch-elf/ie-le-relax.d +++ b/ld/testsuite/ld-loongarch-elf/ie-le-relax.d @@ -1,5 +1,5 @@ #as: -#ld: -z norelro -e0 +#ld: -e0 #objdump: -dr -M no-aliases #skip: loongarch32-*-* diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp index 161cc1a4d10..507b244869c 100644 --- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp +++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp @@ -133,6 +133,10 @@ if [istarget "loongarch64-*-*"] { run_dump_test "desc-relax" } + if [check_pie_support] { + run_dump_test "pie_discard" + } + run_dump_test "max_imm_b16" run_dump_test "max_imm_b21" run_dump_test "max_imm_b26" @@ -145,7 +149,6 @@ if [istarget "loongarch64-*-*"] { run_dump_test "underflow_b21" run_dump_test "underflow_b26" run_dump_test "underflow_pcrel20" - run_dump_test "pie_discard" run_dump_test "desc-le-norelax" run_dump_test "desc-le-relax" run_dump_test "ie-le-norelax" diff --git a/ld/testsuite/ld-loongarch-elf/macro_op_32.d b/ld/testsuite/ld-loongarch-elf/macro_op_32.d index a7349aa8dc0..8fd69922c14 100644 --- a/ld/testsuite/ld-loongarch-elf/macro_op_32.d +++ b/ld/testsuite/ld-loongarch-elf/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\* -- 2.36.0