From patchwork Thu Apr 14 23:21:23 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: 52947 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C852385737D for ; Thu, 14 Apr 2022 23:22:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C852385737D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649978557; 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=ulnRYlbbj0gYx9OjQ4E8YavqHMTl/Zfw3S9fpZ5cib4vKIA64fRqaa3pbbbVEVo30 5ZQbyR1PUVN2w/i7oVEcUMdpQd/AkKLjVPC/A7uP2l68nBVcSMM/vSPk8wnITIRnM0 MWXlYxOxkw1Lt80dVoAH3/Syl/7ke0Kmyonpqlsk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 1DE423857C41 for ; Thu, 14 Apr 2022 23:21:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1DE423857C41 Received: by mail-pf1-x42c.google.com with SMTP id u29so2418247pfg.7 for ; Thu, 14 Apr 2022 16:21:33 -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=5L92oB3wS4ZmZBr3Y8lFWP5BDQcjm4rU5w7/JgObmHpxm84zoKGpiInxGyxJje7Wig suh99+sI5s6ASTAsn3gBD24bGqnPubbd2nfiUHzTGsUEBGQEGVFTQOiKfcduP8ACOg51 I6Ic9tLun6YN36c2zehXb2JIyPMsMrrQarYFdIsxquM0IDB7vFxxgTD2ayPAwtjBLSoa yiRG3L3MhXV7ToePo88YaJbkrHTiUu1hdVhrc5jphoplAfhDRIzuesEbPCO6LEOYxsX+ JnOP9jlcDTvawyhFmtJA6WXFI9fTJ2IZKTo6X6oD93g8xFJxwSqgMx7nEns1n6I6ZUz1 XE2w== X-Gm-Message-State: AOAM5337XWDpBzohTk8Gz7Zq04Le2lzXN+eF9LWC0lsbcYyTMxp8HkrZ xTh9H3Zl0E42uMrQL94HxFc= X-Google-Smtp-Source: ABdhPJwomGgCNYrI3W2htR1jaBWZhp/9hX7xO+wqCmB3Zsv6IOfpmHPghIPMMRzAyqdksI3z6r02ZQ== X-Received: by 2002:a63:4707:0:b0:382:207b:889c with SMTP id u7-20020a634707000000b00382207b889cmr4147528pga.541.1649978492030; Thu, 14 Apr 2022 16:21:32 -0700 (PDT) Received: from gnu-tgl-3.localdomain ([172.58.36.153]) by smtp.gmail.com with ESMTPSA id e13-20020a63370d000000b003810782e0cdsm2800266pga.56.2022.04.14.16.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 16:21:30 -0700 (PDT) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id C195CC03EC; Thu, 14 Apr 2022 16:21:29 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v10 1/7] elf: Define DT_RELR related macros and types Date: Thu, 14 Apr 2022 16:21:23 -0700 Message-Id: <20220414232129.1886210-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220414232129.1886210-1-hjl.tools@gmail.com> References: <20220414232129.1886210-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3028.4 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" --- elf/elf.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) Reviewed-by: Adhemerval Zanella 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 */