From owner-dev-commits-src-all@freebsd.org Fri Aug 6 18:51:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAC6C65C432; Fri, 6 Aug 2021 18:51:51 +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 4GhF2H6Nd0z3Gp6; Fri, 6 Aug 2021 18:51:51 +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 C3C9A12E51; Fri, 6 Aug 2021 18:51:51 +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 176Ipp8l099112; Fri, 6 Aug 2021 18:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176IppLt099111; Fri, 6 Aug 2021 18:51:51 GMT (envelope-from git) Date: Fri, 6 Aug 2021 18:51:51 GMT Message-Id: <202108061851.176IppLt099111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 34e7e4b6a059 - main - Add ElfW() macro for compatibility with Linux MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 18:51:52 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9 commit 34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9 Author: Dimitry Andric AuthorDate: 2021-08-05 18:57:22 +0000 Commit: Dimitry Andric CommitDate: 2021-08-06 18:50:32 +0000 Add ElfW() macro for compatibility with Linux Some Linux software using ELF headers assumes the existence of an ElfW(type) macro, which concatenates 'Elf', the default ELF word size, and the given type. This is identical to our __ElfN(x) macro in . Add the macro for compatibility, with a comment that we prefer the __ElfN() macro for FreeBSD. Reviewed by: emaste, kib Differential Revision: https://reviews.freebsd.org/D31427 MFC after: 1 week --- sys/sys/elf_generic.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h index 301ee52cf7a1..dcd44fe93b14 100644 --- a/sys/sys/elf_generic.h +++ b/sys/sys/elf_generic.h @@ -57,6 +57,9 @@ #define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x) #define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x) +/* Define ElfW for compatibility with Linux, prefer __ElfN() in FreeBSD code */ +#define ElfW(x) __ElfN(x) + __ElfType(Addr); __ElfType(Half); __ElfType(Off);