From patchwork Thu Apr 14 19:04:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1617409 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=GS4ERSYQ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KfTR04rx1z9sFy for ; Fri, 15 Apr 2022 05:04:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA6A13858430 for ; Thu, 14 Apr 2022 19:04:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA6A13858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649963066; bh=1pIo6NV4v1imjLb9rZ/VC/XEKxVKUKTCNqNrNe0UlFk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GS4ERSYQYkOX2gN8+FI7x1COcgkuGRQpHSI2+7KR90j60l0XPufh+huiRRF73x8EL zS+aPlGLiyz5QOTu4TxKH7S6YP1z/BWEnpcw7VXQ40ZkzDe2FCvItvhHMrpZ82aMBc LQOYaXbFYdHa4FEvsSQbbRsxX7bXc8d575nwGkn0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id B387A3858C2C for ; Thu, 14 Apr 2022 19:04:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B387A3858C2C Received: by mail-pf1-x42e.google.com with SMTP id s8so5628514pfk.12 for ; Thu, 14 Apr 2022 12:04:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1pIo6NV4v1imjLb9rZ/VC/XEKxVKUKTCNqNrNe0UlFk=; b=SuYdR3fvrGJvzCb2E9clki+jtLkXdAakWqVf0S07zSm0QM396vrp/agws9YOZjgXQJ LxR1oZBVGeEM73FW0ZOLwkAlEPuE55JNvLUmRVmUQOU+TypYiB092uGFld6kRSPK1fBk 6TEConUaEUnqbPb5RyX4cs19ieE0WSvjzycgjPknbVaw5HSoyJIdRVFNk4dYB+PEMy9v bOXMheoW+krb9+5DT9ROsnCaYT9ts4yv1wl50bY7+anHfNqtxM8mtXkFXj4l3TA0yFR6 V8BWYQpXTX+o+cZyiv0fEFt8PuAM0BD7bdGbBrVoPmW4FBZHx/fDWUu0JpPeOIUP3n7W jCBg== X-Gm-Message-State: AOAM533+dJlUhWsrospXQ6lUzcztCLSLJQ2SpMF9IZ3Q1Iqxr/6LiFnZ suOTFZWMsyB5CnIF6CT04oD4wrYkgsI= X-Google-Smtp-Source: ABdhPJx8jO49ZA0Qli8VeX/pjJqZGjL9YuzUnjtDB2rDSH8ADMiM8HLNjBJU6KIeIT4aNjksslFGQA== X-Received: by 2002:a05:6a02:182:b0:374:5a57:cbf9 with SMTP id bj2-20020a056a02018200b003745a57cbf9mr3328732pgb.616.1649963050717; Thu, 14 Apr 2022 12:04:10 -0700 (PDT) Received: from gnu-tgl-3.localdomain ([172.58.36.153]) by smtp.gmail.com with ESMTPSA id l4-20020a056a0016c400b004f79504ef9csm616729pfc.3.2022.04.14.12.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 12:04:09 -0700 (PDT) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 046CBC02F6; Thu, 14 Apr 2022 12:04:08 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v9 1/7] elf: Define DT_RELR related macros and types Date: Thu, 14 Apr 2022 12:04:01 -0700 Message-Id: <20220414190407.3210003-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220414190407.3210003-1-hjl.tools@gmail.com> References: <20220414190407.3210003-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3028.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" --- elf/elf.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/elf/elf.h b/elf/elf.h index 0735f6b579..0195029188 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -443,7 +443,8 @@ typedef struct #define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ #define SHT_GROUP 17 /* Section group */ #define SHT_SYMTAB_SHNDX 18 /* Extended section indices */ -#define SHT_NUM 19 /* Number of defined types. */ +#define SHT_RELR 19 /* RELR relative relocations */ +#define SHT_NUM 20 /* Number of defined types. */ #define SHT_LOOS 0x60000000 /* Start OS-specific. */ #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */ #define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ @@ -662,6 +663,11 @@ typedef struct Elf64_Sxword r_addend; /* Addend */ } Elf64_Rela; +/* RELR relocation table entry */ + +typedef Elf32_Word Elf32_Relr; +typedef Elf64_Xword Elf64_Relr; + /* How to extract and insert information held in the r_info field. */ #define ELF32_R_SYM(val) ((val) >> 8) @@ -887,7 +893,10 @@ typedef struct #define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ #define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ #define DT_SYMTAB_SHNDX 34 /* Address of SYMTAB_SHNDX section */ -#define DT_NUM 35 /* Number used */ +#define DT_RELRSZ 35 /* Total size of RELR relative relocations */ +#define DT_RELR 36 /* Address of RELR relative relocations */ +#define DT_RELRENT 37 /* Size of one RELR relative relocaction */ +#define DT_NUM 38 /* Number used */ #define DT_LOOS 0x6000000d /* Start of OS-specific */ #define DT_HIOS 0x6ffff000 /* End of OS-specific */ #define DT_LOPROC 0x70000000 /* Start of processor-specific */