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 D2B8E3836EA0 for ; Mon, 5 Jun 2023 10:31:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D2B8E3836EA0 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.20.4.171]) by gateway (Coremail) with SMTP id _____8DxN_F0uX1kMg4AAA--.149S3; Mon, 05 Jun 2023 18:31:16 +0800 (CST) Received: from [10.20.4.171] (unknown [10.20.4.171]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxNeRyuX1kH0wAAA--.1182S3; Mon, 05 Jun 2023 18:31:16 +0800 (CST) Subject: Re: [PATCH v5 0/6] LoongArch linker relaxation support. To: Luis Machado , binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, liuzhensong@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, changjiachen@stu.xupt.edu.cn References: <20230526073833.3933735-1-mengqinggang@loongson.cn> From: mengqinggang Message-ID: <1f244684-f2cc-26e2-9ff3-0c4b8d8ee2f1@loongson.cn> Date: Mon, 5 Jun 2023 18:31:14 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:AQAAf8BxNeRyuX1kH0wAAA--.1182S3 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoW3GrWrCw4kAF4DKFyxKw48AFc_yoWxKr1rpw 18Ar1Yyry8CF1kGr1DGryUJryUJw1xJw1jqr1ftF12kr15Jryjqr18ZrZ0gF4UJ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O_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: Because I don't have a 32-bit machine, I will build a 32-bit virtual environment to handle this issue. 在 2023/5/31 下午5:13, Luis Machado 写道: > On 5/26/23 08:38, mengqinggang wrote: >> This is the v5 version of patches to support loongarch linker relax. >> >> This week, the kernek and grub was tested. >> >> For kernel, I just did a simple test. It can be compiled correctly and >> the OS can boot normally. >> >> There are some "unsupported relocation" compile errors for grub, >> because grub currently does not support relax/b16/b21/add/sub >> relocations. >> >> The new LoongArch ABI gitub repo will be released in the next >> few days. >> >> The patch set changelog: >> >> v4 -> v5: >> 1. Change LOONGARCH to LoongArch. >> >> 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                     | 427 +++++++++-- >>   gas/config/tc-loongarch.h                     |  48 +- >>   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/dwarf-5-macro-include.d |   2 +- >>   gas/testsuite/gas/elf/dwarf-5-macro.d         |   2 +- >>   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              |   8 +- >>   gas/testsuite/gas/loongarch/macro_op.d        |  68 +- >>   gas/testsuite/gas/loongarch/macro_op_32.d     |  24 +- >>   .../gas/loongarch/macro_op_large_abs.d        |  32 +- >>   .../gas/loongarch/macro_op_large_pc.d         | 134 ++-- >>   gas/testsuite/gas/loongarch/relax_align.d     |  26 + >>   gas/testsuite/gas/loongarch/relax_align.s     |   5 + >>   gas/testsuite/gas/loongarch/uleb128.d         |  36 + >>   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-32.d |   2 + >>   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      |  84 ++- >>   ld/testsuite/ld-loongarch-elf/macro_op_32.d   |  24 +- >>   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 +- >>   55 files changed, 2189 insertions(+), 521 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 >> > > This seems to have caused build issues with --enable-targets=all in > 32-bit hosts. > > ../../../repos/binutils-gdb/bfd/elfxx-loongarch.c: In function > ‘reloc_bits_pcrel20_s2’: > ../../../repos/binutils-gdb/bfd/elfxx-loongarch.c:1671:32: error: > format ‘%lx’ expects argument of type ‘long unsigned int’, but > argument 5 has type ‘bfd_signed_vma’ {aka ‘long long int’} > [-Werror=format=] >  1671 |       (*_bfd_error_handler) (_("%pB: relocation %s right shift > %d error 0x%lx"), > > Could you please take a look at it? > > Thanks!