From nobody Thu Feb 17 18:49:08 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 298FD19C1431; Thu, 17 Feb 2022 18:49:09 +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 4K03l90djjz4npc; Thu, 17 Feb 2022 18:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645123749; 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=VgbJt4YtSLMj+KyUD6zFQ25ZDa6fV5GN2W1pP39KSd0=; b=rzK7zHHDS8V/a5sDmyBQSRNr0DpcoplrDSOKAc58d+5y4xYLk4fWXPnk5Oj+xy9C9ukD1P aoYpW4bNBM7LvZvXufaj6TBFUBMROMf+JB923BZXEedcVquklpU8+WnnnJqC1qGInRvnmh 8RTSon0ATneObNwGaDRvL7SaVwkm2iIfHk8YB96bH/YkgeXuLl16Gr5FPWGj670YQxcykZ +qLFUyeE1qmmkuLEjDMVQa7KrEDt4P2k/HlC8rWKccACIUazJs21Q3MYgVHiPxflJVadgH 0HTUwVqLabBXZv9jTLs/x4NNRcyBiJpoDw17wV2e25zp0yqTz/bp5ZjOWZO4lg== 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 EA1B37023; Thu, 17 Feb 2022 18:49:08 +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 21HIn8SN051010; Thu, 17 Feb 2022 18:49:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21HIn8Qg051009; Thu, 17 Feb 2022 18:49:08 GMT (envelope-from git) Date: Thu, 17 Feb 2022 18:49:08 GMT Message-Id: <202202171849.21HIn8Qg051009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 0d27ad33a44c - stable/13 - kldxref: add R_PPC_ADDR32 handler 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: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0d27ad33a44c2c580be5c9eb987428f821a2a1ec Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645123749; 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=VgbJt4YtSLMj+KyUD6zFQ25ZDa6fV5GN2W1pP39KSd0=; b=OSH7gSMsuoMZZOwq3gtNvIA95BJ3h7OT5JXDJhVirVJ1ZEopWTEzEfaYg7ldvofiiDHYRF 9dL9+js2eF2qzGpw5W1K99+M1duAjBpaNVS4Dbt4QU+i8V0cIT0lCtWiWkumTKyJf/CfhD KD2Wquze/6uyQZpqf+OKN3WIfO60G6yJ1ToSWg0QzLcfs0w+afLSKUbD1nwYclGVfLzl1a CAbn4JwvLKPx4bTO23V3dYj2OwwMcVVT6llEEiaXII9G2G5EC6ZsraWWavZNK9HBuQNc2U NJ9PwnafmnJdtcoHyJoohNY/0Dwop+ue5DO8YP5ITOR4obDkRRZC1wLjsBK/Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645123749; a=rsa-sha256; cv=none; b=dwbjFpP0P+Vzq2tSQR9WhdBqiE0/uXExvDO+60lhTc+DWPLFznITiwvAAp4wllEkq2xLV7 MGstnMrzxGcdmKljVJtHaFrCv/BrznqNKU5NWJ2v5/+P3Dt5JqrobVCDuttMu7eAXJSumN +jH3x02e9q3eu1sOuwabqTy66A4MoSk8lmISx8WQ/Py+dzviaX9aorey8P5ykL9R8NQsvJ 4Gcu/rMihGF+AdnIJUnL5JLdOfGR7YXkSfsKRvl4hkaFHImYlVtOFnfcK7D/EOkJR597Xm +3eV2DCWYF1Q4fnZVGKhFHjtikM1VL5amsUYTZgrw41g+AlNIW7Ki9krdRlvnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=0d27ad33a44c2c580be5c9eb987428f821a2a1ec commit 0d27ad33a44c2c580be5c9eb987428f821a2a1ec Author: Alfredo Dal'Ava Junior AuthorDate: 2022-02-17 21:48:52 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2022-02-17 21:48:52 +0000 kldxref: add R_PPC_ADDR32 handler Implements R_PPC_ADDR32 handler for kldxref, addressing "kldxref: unhandled relocation type 1" when running "kldxref /boot/kernel" on powerpc 32 bits. Reviewed by: luporl MFC after: 2 days Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D33745 (cherry picked from commit 79f5d19890c3a703b3808af2dffe9d181a2e1696) --- usr.sbin/kldxref/ef_powerpc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/kldxref/ef_powerpc.c b/usr.sbin/kldxref/ef_powerpc.c index c50f518f892e..45eca477abcd 100644 --- a/usr.sbin/kldxref/ef_powerpc.c +++ b/usr.sbin/kldxref/ef_powerpc.c @@ -55,6 +55,7 @@ ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, Elf_Off dataoff, size_t len, void *dest) { Elf_Addr *where, addend; + Elf32_Addr *where32; Elf_Size rtype, symidx; const Elf_Rela *rela; @@ -63,6 +64,7 @@ ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, rela = (const Elf_Rela *)reldata; where = (Elf_Addr *) ((Elf_Off)dest - dataoff + rela->r_offset); + where32 = (Elf32_Addr *) ((Elf_Off)dest - dataoff + rela->r_offset); addend = rela->r_addend; rtype = ELF_R_TYPE(rela->r_info); symidx = ELF_R_SYM(rela->r_info); @@ -74,9 +76,14 @@ ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, case R_PPC_RELATIVE: /* word32|doubleword64 B + A */ *where = relbase + addend; break; - case R_PPC64_ADDR64: /* S + A */ + case R_PPC_ADDR32: /* word32 S + A */ + *where32 = EF_SYMADDR(ef, symidx) + addend; + break; +#ifdef __powerpc64__ + case R_PPC64_ADDR64: /* doubleword64 S + A */ *where = EF_SYMADDR(ef, symidx) + addend; break; +#endif default: warnx("unhandled relocation type %" PRI_ELF_SIZE, rtype); }