From nobody Sat Oct 16 23:37:34 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E8A7917F1A4F; Sat, 16 Oct 2021 23:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HX01B691zz4f99; Sat, 16 Oct 2021 23:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B078A22743; Sat, 16 Oct 2021 23:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19GNbYqS075792; Sat, 16 Oct 2021 23:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19GNbYFE075791; Sat, 16 Oct 2021 23:37:34 GMT (envelope-from git) Date: Sat, 16 Oct 2021 23:37:34 GMT Message-Id: <202110162337.19GNbYFE075791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1cf06333160a - main - sys: Add definitions for RELR relative relocation format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cf06333160a9a6a4dabeba19f6d67ab55f0dac2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1cf06333160a9a6a4dabeba19f6d67ab55f0dac2 commit 1cf06333160a9a6a4dabeba19f6d67ab55f0dac2 Author: Fangrui Song AuthorDate: 2021-10-16 21:31:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-16 23:37:13 +0000 sys: Add definitions for RELR relative relocation format MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32526 --- sys/sys/elf32.h | 2 ++ sys/sys/elf64.h | 2 ++ sys/sys/elf_common.h | 3 +++ sys/sys/elf_generic.h | 1 + 4 files changed, 8 insertions(+) diff --git a/sys/sys/elf32.h b/sys/sys/elf32.h index ad44b7cf970a..c328ce3b2f80 100644 --- a/sys/sys/elf32.h +++ b/sys/sys/elf32.h @@ -152,6 +152,8 @@ typedef struct { /* Macro for constructing r_info from field values. */ #define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) +typedef Elf32_Word Elf32_Relr; + /* * Note entry header */ diff --git a/sys/sys/elf64.h b/sys/sys/elf64.h index 880166a3e83a..cc5c682e07da 100644 --- a/sys/sys/elf64.h +++ b/sys/sys/elf64.h @@ -166,6 +166,8 @@ typedef struct { #define ELF64_R_TYPE_INFO(data, type) \ (((Elf64_Xword)(data)<<8)+(Elf64_Xword)(type)) +typedef Elf64_Xword Elf64_Relr; + /* * Note entry header */ diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 4df2751b07cf..e8eda4d91260 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -617,6 +617,9 @@ typedef struct { #define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of pre-initialization functions. */ #define DT_MAXPOSTAGS 34 /* number of positive tags */ +#define DT_RELRSZ 35 /* Total size of ElfNN_Relr relocations. */ +#define DT_RELR 36 /* Address of ElfNN_Relr relocations. */ +#define DT_RELRENT 37 /* Size of each ElfNN_Relr relocation. */ #define DT_LOOS 0x6000000d /* First OS-specific */ #define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */ #define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */ diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h index dcd44fe93b14..177de7339d3f 100644 --- a/sys/sys/elf_generic.h +++ b/sys/sys/elf_generic.h @@ -71,6 +71,7 @@ __ElfType(Phdr); __ElfType(Dyn); __ElfType(Rel); __ElfType(Rela); +__ElfType(Relr); __ElfType(Sym); __ElfType(Verdef); __ElfType(Verdaux);