From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 3D8C6384233F for ; Tue, 13 Dec 2022 06:59:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D8C6384233F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.2.5.5]) by gateway (Coremail) with SMTP id _____8DxOem1IphjmjEFAA--.8654S3; Tue, 13 Dec 2022 14:59:02 +0800 (CST) Received: from 5.5.5 (unknown [10.2.5.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx5VatIphjvLktAA--.26681S2; Tue, 13 Dec 2022 14:59:00 +0800 (CST) From: mengqinggang To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, liuzhensong@loongson.cn, chenglulu@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, schwab@suse.de, mengqinggang Subject: [PATCH v2 0/6] LoongArch linker relaxation support. Date: Tue, 13 Dec 2022 14:58:45 +0800 Message-Id: <20221213065851.2777297-1-mengqinggang@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8Cx5VatIphjvLktAA--.26681S2 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjvJXoWxXryUZFyUZry7GFy8Cr1UGFg_yoWrJr4xpa 4UZr1FkF4rGFnrGrn8G3y5u3WkJw4xGrya9a4ftF12kr4ftry8Zw10yr43XFs8J3yjgw1f Zw1Fqw1ruFn8tr7anT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b3kYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l n4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E 87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82 IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1lx2Iq xVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r 1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY 6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67 AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x 07jjwZcUUUUU= X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP 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: This is the v2 version of patches to support loongarch linker relax. The new relocs document at here: https://github.com/loongson/LoongArch-Documentation/pull/77 The patch set changelog: v1 -> v2: 1. Simplified a ld relax test. 2. Use the C99 designated initializer syntax for LARCH_opts.relax. 3. Fix one spelling error. mengqinggang (6): LoongArch: include: Add support for linker relaxation. LoongArch: bfd: Add support for linker relaxation. LoongArch: opcodes: Add support for linker relaxation. LoongArch: binutils: Add support for linker relaxation. LoongArch: gas: Add support for linker relaxation. LoongArch: ld: Add support for linker relaxation. bfd/bfd-in2.h | 8 + bfd/elfnn-loongarch.c | 582 +++++++++++++-- bfd/elfxx-loongarch.c | 676 +++++++++++++----- bfd/elfxx-loongarch.h | 10 +- bfd/libbfd.h | 8 + bfd/reloc.c | 22 + binutils/readelf.c | 84 ++- binutils/testsuite/binutils-all/readelf.exp | 13 +- gas/config/tc-loongarch.c | 412 +++++++++-- gas/config/tc-loongarch.h | 45 +- gas/testsuite/gas/all/align.d | 5 +- gas/testsuite/gas/all/gas.exp | 10 +- gas/testsuite/gas/all/relax.d | 4 + gas/testsuite/gas/elf/dwarf-5-irp.d | 3 +- gas/testsuite/gas/elf/dwarf-5-loc0.d | 3 +- gas/testsuite/gas/elf/dwarf2-11.d | 3 +- gas/testsuite/gas/elf/dwarf2-15.d | 3 +- gas/testsuite/gas/elf/dwarf2-16.d | 3 +- gas/testsuite/gas/elf/dwarf2-17.d | 3 +- gas/testsuite/gas/elf/dwarf2-18.d | 3 +- gas/testsuite/gas/elf/dwarf2-19.d | 3 +- gas/testsuite/gas/elf/dwarf2-5.d | 3 +- gas/testsuite/gas/elf/ehopt0.d | 3 + gas/testsuite/gas/elf/elf.exp | 3 + gas/testsuite/gas/elf/section11.d | 4 +- gas/testsuite/gas/lns/lns.exp | 1 + gas/testsuite/gas/loongarch/jmp_op.d | 65 +- gas/testsuite/gas/loongarch/li.d | 9 +- gas/testsuite/gas/loongarch/macro_op.d | 69 +- .../gas/loongarch/macro_op_large_abs.d | 103 +-- .../gas/loongarch/macro_op_large_pc.d | 103 +-- gas/testsuite/gas/loongarch/relax_align.d | 25 + gas/testsuite/gas/loongarch/relax_align.s | 5 + gas/testsuite/gas/loongarch/uleb128.d | 35 + gas/testsuite/gas/loongarch/uleb128.s | 20 + include/elf/loongarch.h | 20 + include/opcode/loongarch.h | 3 + ld/emultempl/loongarchelf.em | 3 + ld/testsuite/ld-elf/compressed1d.d | 3 + ld/testsuite/ld-elf/pr26936.d | 4 +- ld/testsuite/ld-loongarch-elf/disas-jirl.d | 4 +- ld/testsuite/ld-loongarch-elf/jmp_op.d | 65 +- ld/testsuite/ld-loongarch-elf/macro_op.d | 138 ++-- ld/testsuite/ld-loongarch-elf/relax-align.dd | 7 + ld/testsuite/ld-loongarch-elf/relax-align.s | 9 + ld/testsuite/ld-loongarch-elf/relax.exp | 73 ++ ld/testsuite/ld-loongarch-elf/relax.s | 16 + ld/testsuite/ld-loongarch-elf/uleb128.dd | 10 + ld/testsuite/ld-loongarch-elf/uleb128.s | 21 + opcodes/loongarch-opc.c | 5 +- 50 files changed, 2192 insertions(+), 540 deletions(-) create mode 100644 gas/testsuite/gas/loongarch/relax_align.d create mode 100644 gas/testsuite/gas/loongarch/relax_align.s create mode 100644 gas/testsuite/gas/loongarch/uleb128.d create mode 100644 gas/testsuite/gas/loongarch/uleb128.s create mode 100644 ld/testsuite/ld-loongarch-elf/relax-align.dd create mode 100644 ld/testsuite/ld-loongarch-elf/relax-align.s create mode 100644 ld/testsuite/ld-loongarch-elf/relax.exp create mode 100644 ld/testsuite/ld-loongarch-elf/relax.s create mode 100644 ld/testsuite/ld-loongarch-elf/uleb128.dd create mode 100644 ld/testsuite/ld-loongarch-elf/uleb128.s -- 2.36.0