From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2081.outbound.protection.outlook.com [40.107.105.81]) by sourceware.org (Postfix) with ESMTPS id B650B3839069 for ; Mon, 5 Jun 2023 10:33:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B650B3839069 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YBwtN1v0E3SVpdDCULVqYyivjdPE/KKGQ2/abD9Gv34=; b=h8M21rHs4QiRPyO67RiQD0z5IUecHWPtQRF7pHNyfpc6yQc5bTByi3gISqN05u5j1NTQDbwejIlq4WIy2D7XLzDeH8hT2HJBniIcPdtXcocLXKoHKeKbYsH9MIG85a/3RhLXTkWjj/tFEeAvjYf028jLLxpSG5D8KFWxmU1IWjY= Received: from AM6P192CA0075.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::16) by PR3PR08MB5612.eurprd08.prod.outlook.com (2603:10a6:102:8f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 5 Jun 2023 10:33:26 +0000 Received: from AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::37) by AM6P192CA0075.outlook.office365.com (2603:10a6:209:8d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32 via Frontend Transport; Mon, 5 Jun 2023 10:33:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT041.mail.protection.outlook.com (100.127.140.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.14 via Frontend Transport; Mon, 5 Jun 2023 10:33:26 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Mon, 05 Jun 2023 10:33:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 585f81ba3dfe296b X-CR-MTA-TID: 64aa7808 Received: from fa538a469fe8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 72F95E5C-3958-4013-8138-CD8F9E4F0B8C.1; Mon, 05 Jun 2023 10:33:20 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fa538a469fe8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 05 Jun 2023 10:33:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EISL08wtORakTHOKHhPfakanIoUPhj5GT67hcEX7XrC0L6tYj9SLzZH3g8j73JUZ3r/6trLir2ngD42kZC7+DcI/aYSdXTxQktgjTwcRTbT0s1t7aVRRo+5Qpi4HlEYgUY0OMUUmM62d7c9X6b7/6WAUWQpom0Xr+vJUP2fAXwfbPGh2l146fYFc639wXEWJIM2yRhMMdykgWm4lwnd4Hafxeo3ddUclmK5ZJE3eMJ7qbK7A42IlQs4ffFNMGN2hM7SAdhyDH9rzTABUxwyFrhwpc4tRF3JG8W0ridsdCTCUcS0MqTH7Luk1mxpiPXa7Y2ioQIk9MkwhdEEia+ciXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YBwtN1v0E3SVpdDCULVqYyivjdPE/KKGQ2/abD9Gv34=; b=a+ayOdBbZnJqbe/7paSDDKOZj6LdUA1B+SAD7cJjta34LMfp1r3g8iN3SDh6TpuBggcwrc8CjaTLfz1HKu5ufWl0/g98j/OetVbIuZYIZ/7If2lZEdo7qRVrwdpFQWi0b7ZM59ploxuRfFfT80TUWMYyIKmHzoaieIkZ02IaGZ1YAtSY+gdNicMTG5IAn16nlx3Cpt4J/JXBDxRkGOnJ8fDqVQa1RNWmkMZ7fSJGj0MdlLJfTuTyZEbRapqHik5j3blD9r+1DmbKTzBiwXvVybnTobNIvaDk4mttKqT2jty5j7EGzJhRyU/W65NHpVudbIjdJBIIuaF9BUoPqusVUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YBwtN1v0E3SVpdDCULVqYyivjdPE/KKGQ2/abD9Gv34=; b=h8M21rHs4QiRPyO67RiQD0z5IUecHWPtQRF7pHNyfpc6yQc5bTByi3gISqN05u5j1NTQDbwejIlq4WIy2D7XLzDeH8hT2HJBniIcPdtXcocLXKoHKeKbYsH9MIG85a/3RhLXTkWjj/tFEeAvjYf028jLLxpSG5D8KFWxmU1IWjY= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AS8PR08MB6485.eurprd08.prod.outlook.com (2603:10a6:20b:318::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 5 Jun 2023 10:33:18 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c6b8:4dc0:6f9:7f40]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c6b8:4dc0:6f9:7f40%3]) with mapi id 15.20.6455.030; Mon, 5 Jun 2023 10:33:18 +0000 Message-ID: Date: Mon, 5 Jun 2023 11:33:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v5 0/6] LoongArch linker relaxation support. Content-Language: en-US To: mengqinggang , 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> <1f244684-f2cc-26e2-9ff3-0c4b8d8ee2f1@loongson.cn> From: Luis Machado In-Reply-To: <1f244684-f2cc-26e2-9ff3-0c4b8d8ee2f1@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0059.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::15) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB6485:EE_|AM7EUR03FT041:EE_|PR3PR08MB5612:EE_ X-MS-Office365-Filtering-Correlation-Id: 9717d3c0-1baf-4e7d-74f0-08db65b04c0b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: sE4Axd6IYnxcRVZQeFRdRUv9FRWrDZ7B5Y/1zzgjKVKrR/1cfbn3222iSOL/HpOhC5/hn7KuEY+tAXycxjlpM//EPCVtKEgXvpjOkKu9Hbh7mbHYYLHm3I0vKny3lRy1UwSf1sCMLO5sgdn1v7aET06+uIindvxbPX1MP0JifaFyRdcpsurG5abYcXeLwLSRCiI/RMLqB9bPofC/FZkJTtJxLWTmwKNRnuFRrfxakRVqcES6TANkqKAw265KD1T5jORpS2Hw9hs9Y1+sYpZOtNgxy9iTSY7mXzfN+UGERe1DmK5NGBtDbOnf+LNGJ6hTJ82+lO0Ig8RtRftIPa8wwfWrmI4MSBbpgvRiQRXG/RBTciWjUHDOURiiiwuER2/YQ80UX+E0ybUs0j9bn2UiUChDWmlTOYOpJWsXKZ4H3b9XjTP3pE+csurGrn+M+4nBMEhhMVSwAwaiXgK+5O6atVTDBhSygcBpyO1tnegaoBOpKLbmUNH1ihGEx2Mu5V0Y8IQITQilEDmlI3XZtiGdV5Y6oeq9bNl0rSDQZAbW1BEvnj0BN1SDEaeVoHxFHoXV9vf7b0mkfZFcu5P3A6SexR7GbTTP0im3XgPistTND6x0kq9LG+fEzh3+Hwr88Rkdz6m0a28Wp+10GQsVxbA7mg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(396003)(376002)(346002)(366004)(451199021)(83380400001)(4326008)(966005)(38100700002)(66476007)(66946007)(66556008)(6666004)(6486002)(478600001)(36756003)(186003)(2906002)(8676002)(8936002)(41300700001)(316002)(2616005)(5660300002)(31696002)(86362001)(44832011)(31686004)(53546011)(26005)(6506007)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6485 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c2c22b6c-14b3-4e04-d88d-08db65b0443d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nanZ3zs+zewE+JeeEqz+OIkxW6doc7lIeh71QvYpwSVW9gpYhLXgfchvUnxl1WChw6ae9xJ2SzRVKPptpAjOHgBkS670KuL1Oc9RBEpphUIDXKi50qssqdoD3h9RIxEdmEBWSVKvwpMrzNRXmHXmXE65obNx6m7RSDTNrLvo9XBsKRquhMHWJ4ogoXKwlKjEQkallWADe71ff8edC7wdY4Vr6VE/v7qM5WrWQObs+9n+bCi4YbUNGGE8lt8lAzDX8efegAofUF2s7Rq+V8x1vTguls3PMd0LuKZpz4nAuqmPDWsXmcIQ8vHGhMCr1gm/j4AVs2URUPErN78vLdgUaaV1XynIw9gn1/bkxNL6z5pOC1OB7yJgK0biEWuA/AIyJRxcPxs4oUoGnwsuKO/8iHylbQMVbuHume1L4F+5Z81bvTTEeVi6JwAiN9s4olfTHFQpw+NOYBapleW2FuTqf9JMIeQLOw6CdqLcQ8uEgm3RrPMyIUPEMaRMF6WUCSv2BZeWcntRgmX7dGKi19ZTz6XBunwga5Rl1MWIIRlYBAeCZ4M6QwhDW8wstEaETlGue5r/audpmJdGbqAMErmKsM/xPoIxUXKJn4/DjeM95NWlU77aYCGkt/A3kyMajPVnrFq0NRfdl7LXmraxoQJfeSiOGYsTwWPWQmPqxUaUygU9V2q+Rd3+Ao5XAHEOz6zE8L7enqqfVMQ0Qvoz590qKrX2A2BVXZypVtXtnDox4wx1e206885SVGPg+Z4iKTftERiGQu7Q9ZMFmP4zwDyPNQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39860400002)(346002)(136003)(451199021)(40470700004)(46966006)(36840700001)(107886003)(53546011)(6512007)(6506007)(2616005)(41300700001)(31686004)(6486002)(336012)(6666004)(47076005)(36860700001)(186003)(26005)(966005)(83380400001)(82310400005)(40460700003)(478600001)(40480700001)(4326008)(81166007)(82740400003)(356005)(70586007)(70206006)(316002)(8936002)(8676002)(5660300002)(44832011)(2906002)(31696002)(86362001)(36756003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 10:33:26.6900 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9717d3c0-1baf-4e7d-74f0-08db65b04c0b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5612 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Thanks. I think Nick already address it here: https://inbox.sourceware.org/binutils/87a5xkua9s.fsf@redhat.com/ On 6/5/23 11:31, mengqinggang wrote: > 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! >