From nobody Thu Feb 10 12:15:52 2022 X-Original-To: dev-commits-src-main@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 C201119CB35D; Thu, 10 Feb 2022 12:15:52 +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 4JvbLc551xz3LdX; Thu, 10 Feb 2022 12:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644495352; 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=opScKXIx6bXnyylmprECOFskYa9BnXcGK9q+mdFOEcw=; b=y3Pf5l45MpEwW/uQulq4gRXITqjsN6P9SR3Hv/moKKE2gJpMhUr9qyNklMXXXKO/q74Rfi qk88T0d6jvmNhtwPdgUOIUXU4yTMR7vGoSQaOCABdm99kuD7FTgqj+ss/kCyH8gELjSEl9 nduK23jNwiVGZ7ItGNq70CQ4Wq7jS4W8//zlog6PqPNuZ82JTVRbt1dA1Q+JKn2x78TFeX iRjOzLqvRm3OkV7xeGYNY9h3M7fjsV6X2XC1aTL72KVeBhCNhYW/eJG77DqFxx4tGNe4Zy eEX75VdQEW+NDgwyO3ZyBaM+56tkEdtizhoG4m1HBNwvHTqEAStWhssCFI6RlA== 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 8F2C520149; Thu, 10 Feb 2022 12:15:52 +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 21ACFq0p028782; Thu, 10 Feb 2022 12:15:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21ACFqdW028781; Thu, 10 Feb 2022 12:15:52 GMT (envelope-from git) Date: Thu, 10 Feb 2022 12:15:52 GMT Message-Id: <202202101215.21ACFqdW028781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 79f5d19890c3 - main - kldxref: add R_PPC_ADDR32 handler List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 79f5d19890c3a703b3808af2dffe9d181a2e1696 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644495352; 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=opScKXIx6bXnyylmprECOFskYa9BnXcGK9q+mdFOEcw=; b=mV4ygcZ2ROG6ckbzcMMrGqJowiNKa7DtdrGBGADxvmBZgiXA7yPdthudDOwZQ6lV8Fqnph vJvPh6zN3Z00dMKXDlSDRPd09nWyiUJLP80TB/Zb7lP4093vaLj5LFNWr1qIInl+Ncz1RF SHaC+pf+Ho55I6Q4PGjhnOBnui08N1Z29HHlJk0k+fogmgMk65YHWoN+ACUGhJdEXXxOFW j3HWi+7AlmaJ5KSnh3+eKR9yH45wb5R7pCQwgz9k0O6CBlzcwTXR6yfR4/WXcYueD//yn7 oYtl5EYaPdM60NlOYRJwuCreG4U7HaZEbk1VJrXkQXVwpW4fyK8HapOXDXvnSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644495352; a=rsa-sha256; cv=none; b=XMzofsJNd8yLbb4/6+rwEgoAJ7X/2+p7KhNVuU7TGKlITyVU8JkLhwbgnQZqvLhbHwZCdI +sOPhWJSUJzbTupdw+HBKrA23uhJAyq1wAD+YepyRXp5Yosg3V3LQlwb2YPKuEnTWvpKjw 1dbilAvbjAxWRhoIjkSTwZAgxMC04LEz08p0022bc0b/WCJGGC2Q7bYr0+1ZmWEAyXyvCw +xvX++FsKeRW9yw6asOlXpRtDrCadWiRRczRKRV5ui09g+cu0wG6ABlaN+mgpjB2vIl0hq VYtKW41ED9oTbeBfO9wbYWYDgSg1ApanuB+d2TU3sTGyuebU0lwycvqr9k0XhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=79f5d19890c3a703b3808af2dffe9d181a2e1696 commit 79f5d19890c3a703b3808af2dffe9d181a2e1696 Author: Alfredo Dal'Ava Junior AuthorDate: 2022-02-10 15:12:04 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2022-02-10 15:15:47 +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 --- 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); }