From nobody Fri Sep 16 15:54:05 2022 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 4MTdsn4y2zz4cL9Y; Fri, 16 Sep 2022 15:54:05 +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 4MTdsn3yvyz3j6s; Fri, 16 Sep 2022 15:54:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663343645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EY1XAy9tAJYjzZuOWoBNHd4oga6Aa9h7+DvSuhoCCGY=; b=IMgWF8urASjWlH35qzRwDO0uBs/q4LFgMpU+BY4kPF9vrfcjdHOkRuhJJJFv8rwNvnmW7T Et1AUqV0w8kuCF1YR0KEQsStgOZ+0BXmRG4wtL6iRIEMWmeDiigPQMH30ybfel5bUfDuCB rBgmvYtOQZv/4mY7XbmIRX+pnlBKVZFLLJSyGY2fO7l3sG3SGmS9GAX8maPegksYLkWucG GF3loOWkdoC8q4MqPP/3diFGWqxUFgQJcYMAj7O/QVCUZfNaa6JK4/C5gmoC37dWf6mZJf Z4PRJVrsNd9d83aCc71kO81jQQdwfTAOUtC/E5g97CYSZReOPqVm87stTFfzlw== 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 4MTdsn2mpFzPwN; Fri, 16 Sep 2022 15:54:05 +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 28GFs5wd086639; Fri, 16 Sep 2022 15:54:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28GFs5wG086638; Fri, 16 Sep 2022 15:54:05 GMT (envelope-from git) Date: Fri, 16 Sep 2022 15:54:05 GMT Message-Id: <202209161554.28GFs5wG086638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c0ecae78abbe - main - stand/elf: Only support swapping headers on powerpc. 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0ecae78abbe5c925cd05d5e218aa6f038cd03c7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663343645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EY1XAy9tAJYjzZuOWoBNHd4oga6Aa9h7+DvSuhoCCGY=; b=gpQu9orvd/m9QrNXd/mTSb2bRvIczVzfpMuUk+THWfJ0nqBD2y1jQwOBVIQtkzP1IEUnTP fTlXSyzZ6qRDHQPwMcHU1LvxRwChnpKVE6r9DBxvYmynh7len1jffO8pztwI+Ye4SteXvc tMM7l8xys4XaIvUmfw7Y+8CB15spyXSczkPCbVi3icHqiWSwp9oymvfjj7ilAMCLQuaImK A9GZUQzWevIQOpC3/NvcAzf+v7BNF3TMf2JrhbO1eBIW57FWZ/aocS1isvRErMsycS6v1t dirwxFnT4STH332L/9VKWRZ7jsBx5dw1x+JhrEM7Omv/6Bxu1Vm+f6w4MGa2PA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663343645; a=rsa-sha256; cv=none; b=UKq30/fM6d66p9Fl1BGDXlzSY7fRu9tIMn/Z9xDMngqxQPDe3x5qJ+Q9uK4B56OqKj8reP FujOkEGDobvprcBlB1cZOh56hBaBMiujmbCIywzyc6WalwfSCPVyB4z/9emLONFj1vx9RV rTxhAnSH2FKH/Ztk56fnXJz6nyiJI1fIgwzwM2VMqCZwoLI/hp2NkVj9AYHGOVsx1joRaM cvtGYXHw6MSCMTIcPokUaJB4s7aDVRho3cetrJxaJ3KOuSjjkwTzZ9zBNj2H41nNZcCVF6 jP8ZGAiI+NDuc/5ki7WV/fuWTTOVtScC2FkbjYZsgTSz6Y4DOmImG6Cj1iYIwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c0ecae78abbe5c925cd05d5e218aa6f038cd03c7 commit c0ecae78abbe5c925cd05d5e218aa6f038cd03c7 Author: Warner Losh AuthorDate: 2022-09-16 15:10:14 +0000 Commit: Warner Losh CommitDate: 2022-09-16 15:18:57 +0000 stand/elf: Only support swapping headers on powerpc. Powerpc is currently the only architecture that we support more than one endian. It's the only one that benefits from this swapping, so restrict the code to there. This saves about 1k in the i386 BIOS loader. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D36577 --- stand/common/load_elf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index fd9985f51bf9..463578ec3a6b 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -98,6 +98,7 @@ const char *__elfN(moduletype) = "elf module"; uint64_t __elfN(relocation_offset) = 0; +#ifdef __powerpc__ extern void elf_wrong_field_size(void); #define CONVERT_FIELD(b, f, e) \ switch (sizeof((b)->f)) { \ @@ -203,7 +204,22 @@ static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) } #undef CONVERT_SWITCH #undef CONVERT_FIELD +#else +static int elf_header_convert(Elf_Ehdr *ehdr) +{ + return (0); +} + +static int elf_program_header_convert(const Elf_Ehdr *ehdr, Elf_Phdr *phdr) +{ + return (0); +} +static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) +{ + return (0); +} +#endif #ifdef __amd64__ static bool