From patchwork Thu Dec 14 06:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengqinggang X-Patchwork-Id: 18037 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8355265dys; Wed, 13 Dec 2023 22:39:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPcDQVkvldrgkcJxDNw/1XxOnRIuABtbhCWgiPzTpYgJopaCLFsc3A7jUaEuQT8asouLw0 X-Received: by 2002:a05:622a:1b8b:b0:423:93d7:8078 with SMTP id bp11-20020a05622a1b8b00b0042393d78078mr11169718qtb.47.1702535971039; Wed, 13 Dec 2023 22:39:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702535971; cv=pass; d=google.com; s=arc-20160816; b=ZxjO35duV3MpTui4EeC3qPQ+yoZQzh3tJmjUGTQOzXStNCFEwtPMbGuhfhfrPEgdTP qeuCJAur6ZRNSafd/F6hCUdXZLAAKhXoM4hFrnMRwX72EQKq+2Qpt5zWqiQxAtL4980B 7J2y3qOZxeOZ+1qogCO6QFl4uQqe0Q0fr4Oa9ubNtt7sn4dLLMsx/QDdkqy5/T3ZRJVf WXWO80Oq/46uzl76808Kk6F58ZquO1jh2QQYz6FgzqPuFGWN/pMIocjZzbK6k/CKnOWJ ELQsLq+P3HVdwB3KgLxXVqWYfBfJfgqBKXxobQ4pdNi3G2pXhZvuBidcHlPMzN37bz2F dx0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:arc-filter :dmarc-filter:delivered-to; bh=b//TOYGamdkPmsluhq43wNF7fvX1IyMiHWpfLNVxaHU=; fh=IjBrBzj0HafC7UFRTZLmdEImc4JDKXFiCrZAu8bdkFw=; b=VduJbxnmdacpinhf4Y3iZvwc+w4uhoAjefceTYT+QWSqQyFBMYdpDe9aB1MpJTvc+Z pSo2tVuWe+3oX2Meq6IIdw8JiUpD31YVLEF37/UnffQ9Vile2H6s6aDiiQ7jq5Q+P2fX C6ARNJJYjJJLILBEHcdqjXmKLZEw3HEx1vXzmtMUUDfFCNPJ4OMIC1BwpDr2+hNb4xm1 M+5dDryHIG6tAiVqklbPWuX/B9lfCovd5CKsqi9ANZO7tLJHupYoMKITct0rNN/HPc/E 2ChQfezMtQNVOonO9FL196Z8Msrx0ywLNIJ2Rm2M2+2FmT1itVXT2d40QQnql07vWBcX SNaw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h19-20020ac87153000000b0042557f0cb16si4180403qtp.739.2023.12.13.22.39.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 22:39:31 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDD6B385C6D7 for ; Thu, 14 Dec 2023 06:39:30 +0000 (GMT) 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 1D1283858C2C for ; Thu, 14 Dec 2023 06:39:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D1283858C2C 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 1D1283858C2C 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=1702535966; cv=none; b=ISv5HSeo/wzoSCaVhf3kC19VnQ9hlQXNrilF08wP1VyB5DFFDCmLGsPx67dv4l5OKFxT4JUub42T1YoFQ3Y9lA0DIsjBUkAQNaSLuxExOxlVLZTCCsOQ7fVlHa1QhWBLXFze+ZDqXgvpn8tH4iJ8EwEUbnl6XpKbzC8fJfAedJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702535966; c=relaxed/simple; bh=nvMgCRNQMrHpuUqYUNom8Yc+jEruL7ztXiYrUtaEdMg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=TRSluVOyu4Y/yJde+u+i3xWNHa7+oP/KJTOf68ELi2Wvos5Yow/MFNJm6d11OogyDH0RpPv0sHRyOADxebDbd+DELkAcfbfI9PUzzEYvQtwAWZBautdgZtwscmhr8/trecqvKVv1ngGm4QUzyCfbL+8JTfnyNr9lStwRYD4mVCw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.2.6.5]) by gateway (Coremail) with SMTP id _____8BxK+kYo3plTO8AAA--.5511S3; Thu, 14 Dec 2023 14:39:21 +0800 (CST) Received: from 5.5.5 (unknown [10.2.6.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx3+EWo3pl6cUDAA--.21837S2; Thu, 14 Dec 2023 14:39:18 +0800 (CST) From: mengqinggang To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, liuzhensong@loongson.cn, cailulu@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn, wanglei@loongson.cn, hejinyang@loongson.cn, mengqinggang Subject: [PATCH v2 0/2] Add new relocation R_LARCH_CALL36 Date: Thu, 14 Dec 2023 14:39:14 +0800 Message-Id: <20231214063916.2340161-1-mengqinggang@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx3+EWo3pl6cUDAA--.21837S2 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj9xXoWrKFWxZr1DGrWUZryxWry5Jrc_yoWkKFbEqF 1fAr9rGFWxA3W3Aa4Igry5AayYkF48WF9a9FnYyFZ7WF9rXF45Aw4DXry5uryUKw1DtF45 ArZ8tryfAwnrJosvyTuYvTs0mTUanT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb3AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1ln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y 6r17McIj6I8E87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7V AKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v2 6r1Y6r17MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17 CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF 0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIx AIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIev Ja73UjIFyTuYvjxUwUUUUUUUU X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785238358503826669 X-GMAIL-MSGID: 1785238358503826669 R_LARCH_CALL36 is used for medium code model function call pcaddu18i+jirl, and these two instructions must adjacent. Add call36 and tail36 pseudo instructions. Changes from v1 t0 v2: call func -> call36 func tail func -> tail36 $t0, func mengqinggang (2): LoongArch: Add new relocation R_LARCH_CALL36 LoongArch: Add call36 and tail36 pseudo instructions for medium code model bfd/bfd-in2.h | 1 + bfd/elfnn-loongarch.c | 19 ++++++++++----- bfd/elfxx-loongarch.c | 24 +++++++++++++++++++ bfd/libbfd.h | 1 + bfd/reloc.c | 3 +++ gas/config/tc-loongarch.c | 6 ++++- gas/testsuite/gas/loongarch/medium-call.d | 21 ++++++++++++++++ gas/testsuite/gas/loongarch/medium-call.s | 8 +++++++ include/elf/loongarch.h | 2 ++ .../ld-loongarch-elf/ld-loongarch-elf.exp | 12 ++++++++++ ld/testsuite/ld-loongarch-elf/medium-call.s | 9 +++++++ opcodes/loongarch-opc.c | 11 +++++++++ 12 files changed, 110 insertions(+), 7 deletions(-) create mode 100644 gas/testsuite/gas/loongarch/medium-call.d create mode 100644 gas/testsuite/gas/loongarch/medium-call.s create mode 100644 ld/testsuite/ld-loongarch-elf/medium-call.s