| Message ID | 20260707174719.1883721-1-mengqinggang@loongson.cn |
|---|---|
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B766B4BA2E2B for <patchwork@sourceware.org>; Wed, 8 Jul 2026 01:55:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B766B4BA2E2B X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 5BBB84BA2E0A for <binutils@sourceware.org>; Wed, 8 Jul 2026 01:54:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5BBB84BA2E0A 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 5BBB84BA2E0A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783475684; cv=none; b=IS8uQdwih8wK5uhcFQlq/TtBcJ2rL6GMlOCGkzBn3CGNrIonQfd7IGj4bRDTa9ci0LOkT0bbRZtwyCNYO9+pNXx/Gv2Y8JfVB32psUpXUoHoYdVbNeZ4ueuhCxHeMjYc1oxW5+X3iKuxHo5NkErQkZVy5btEdry6tVO9LKDxL88= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783475684; c=relaxed/simple; bh=fGjqQXW8R6Q7h2KHJxpqyTErvuoKHalNXw8VxytK44w=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=q5EF6WWviynFAPHaF4au3qWyZbn5ImMBcgLeMSZWB433XCIwQZCVK44hWYrP3cq8hxkMBxJp9DVUzXgwwmsaVdzKWXmnl2cjKWz9PEEYsFDkml87iLZEvCLBaqUH46ztg8QjY+MRIHyCS9XdUCY6EBt0qXsxw0KDOFLwAfL5/B8= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BBB84BA2E0A Received: from loongson.cn (unknown [10.2.6.7]) by gateway (Coremail) with SMTP id _____8Dx9+rfrU1qyDsBAA--.5343S3; Wed, 08 Jul 2026 09:54:39 +0800 (CST) Received: from amd9754.. (unknown [10.2.6.7]) by front1 (Coremail) with SMTP id qMiowJCxbsXerU1qAgMFAA--.27137S2; Wed, 08 Jul 2026 09:54:38 +0800 (CST) From: mengqinggang <mengqinggang@loongson.cn> To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, zhaozhou@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, luweining@loongson.cn, mengqinggang@loongson.cn Subject: [PATCH v0 0/4] Emit fewer relocations for linker relaxation Date: Wed, 8 Jul 2026 01:47:15 +0800 Message-Id: <20260707174719.1883721-1-mengqinggang@loongson.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qMiowJCxbsXerU1qAgMFAA--.27137S2 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DATE_IN_PAST_06_12, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Emit fewer relocations for linker relaxation
|
|
Message
mengqinggang
July 7, 2026, 5:47 p.m. UTC
mengqinggang (4):
LoongArch: Fix the size of tls desc relocations
LoongArch: Do not emit relocation if addsy and subsy are in the same
frag
LoongArch: Emit fewer relocations for label subtraction
LoongArch: Emit alignment relocations after relaxed instructions
bfd/elfxx-loongarch.c | 8 +-
gas/config/tc-loongarch.c | 230 ++++++++++----
gas/config/tc-loongarch.h | 11 +
gas/testsuite/gas/all/gas.exp | 2 +-
gas/testsuite/gas/all/relax.d | 4 -
gas/testsuite/gas/elf/ehopt0.d | 3 -
gas/testsuite/gas/loongarch/insn_int32.d | 279 ++++++++---------
gas/testsuite/gas/loongarch/insn_int64.d | 29 +-
gas/testsuite/gas/loongarch/jmp_op.d | 94 +++---
gas/testsuite/gas/loongarch/jmp_op.s | 2 +-
.../gas/loongarch/la_branch_relax_1.d | 118 ++++---
.../gas/loongarch/la_branch_relax_1.s | 2 +
.../gas/loongarch/la_branch_relax_2.d | 64 ++--
.../gas/loongarch/la_branch_relax_2.s | 23 +-
.../gas/loongarch/negative_right_shift.d | 67 ++--
.../gas/loongarch/negative_right_shift.s | 9 +-
gas/testsuite/gas/loongarch/no_thin_add_sub.d | 30 +-
gas/testsuite/gas/loongarch/no_thin_add_sub.s | 1 +
gas/testsuite/gas/loongarch/relax-align.d | 46 +++
.../{relax_align.l => relax-align.l} | 0
.../{relax_align.s => relax-align.s} | 6 +-
gas/testsuite/gas/loongarch/relax-align1.d | 8 +
gas/testsuite/gas/loongarch/relax-align1.s | 16 +
gas/testsuite/gas/loongarch/relax-align2.d | 27 +-
gas/testsuite/gas/loongarch/relax-align2.s | 4 +
gas/testsuite/gas/loongarch/relax-uleb128.d | 9 +
gas/testsuite/gas/loongarch/relax-uleb128.s | 18 ++
gas/testsuite/gas/loongarch/relax_align.d | 52 ----
.../gas/loongarch/relax_debug_line.d | 9 +-
gas/testsuite/gas/loongarch/relocs_32.d | 175 +++++------
gas/testsuite/gas/loongarch/relocs_32.s | 11 +-
gas/testsuite/gas/loongarch/relocs_64.d | 291 +++++++++---------
gas/testsuite/gas/loongarch/relocs_64.s | 3 +
.../gas/loongarch/thin_add_sub_relax.d | 20 +-
.../gas/loongarch/thin_add_sub_relax.s | 2 +
gas/testsuite/gas/loongarch/uleb128.d | 36 ---
gas/testsuite/gas/loongarch/uleb128.s | 20 --
ld/testsuite/ld-elf/compressed1d.d | 3 -
ld/testsuite/ld-loongarch-elf/jmp_op.d | 50 ---
ld/testsuite/ld-loongarch-elf/jmp_op.s | 23 --
.../ld-loongarch-elf/ld-loongarch-elf.exp | 2 -
ld/testsuite/ld-undefined/undefined.exp | 2 -
42 files changed, 899 insertions(+), 910 deletions(-)
create mode 100644 gas/testsuite/gas/loongarch/relax-align.d
rename gas/testsuite/gas/loongarch/{relax_align.l => relax-align.l} (100%)
rename gas/testsuite/gas/loongarch/{relax_align.s => relax-align.s} (79%)
create mode 100644 gas/testsuite/gas/loongarch/relax-align1.d
create mode 100644 gas/testsuite/gas/loongarch/relax-align1.s
create mode 100644 gas/testsuite/gas/loongarch/relax-uleb128.d
create mode 100644 gas/testsuite/gas/loongarch/relax-uleb128.s
delete mode 100644 gas/testsuite/gas/loongarch/relax_align.d
delete mode 100644 gas/testsuite/gas/loongarch/uleb128.d
delete mode 100644 gas/testsuite/gas/loongarch/uleb128.s
delete mode 100644 ld/testsuite/ld-loongarch-elf/jmp_op.d
delete mode 100644 ld/testsuite/ld-loongarch-elf/jmp_op.s