From nobody Mon Dec 27 15:36:48 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 63E54191A887; Mon, 27 Dec 2021 15:36:49 +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 4JN1xF0yTdz4l5m; Mon, 27 Dec 2021 15:36:49 +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 EF055206E3; Mon, 27 Dec 2021 15:36:48 +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 1BRFamL2044274; Mon, 27 Dec 2021 15:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BRFamh7044273; Mon, 27 Dec 2021 15:36:48 GMT (envelope-from git) Date: Mon, 27 Dec 2021 15:36:48 GMT Message-Id: <202112271536.1BRFamh7044273@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: c3d9c63329a8 - main - kldxref: add R_PPC64_ADDR64 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/main X-Git-Reftype: branch X-Git-Commit: c3d9c63329a8b70a0a3b139c7819ace13aab6716 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640619409; 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=R8HeyczkJZWhmmmxMPq4EV19wmnStJOl60pE4XJhAmo=; b=t1g0YNiu0e3XmLkEWWy+hlnZdpewE2FIq586FvsOl/XYHSmRhEDKXdeOWSyDcs3yeK/7xx 5CFsK1qxSSNQTGgUtchEMcz9/BtAlpMQ54TRQQJ33VH3H7yG+S3w+x4IAb1Oq2GP3PtiP7 nML1bOvbZT+1FopI3GbY9YI3I6naQ0CUnbMuXl/hYDL2QNcD1ibOHVVsS+aC9Z6yUbwynA pvxWHt8be6Fr7zMZe0I43F5CzS+Spon45gcwOohcFs3LX2QNO7esBZH9zhwq7/5Oq5BCIs hfwl70wjUnyT2eZEFfWZ/2xWr1d9PeMYzddvT61HRDSjpls01X7ezpTWp05xuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640619409; a=rsa-sha256; cv=none; b=E95Cj6ZuxurHI+zPVtNcGQRJ0G0w6zsVQj/E6nMp8X9W3T1o4yh2TL6SyGG/Po97LXyeq+ NdKltz1c0ON8rUUA+AlbkR0no89Xpv96Uc1h5vfbKX11C1oGLp1XLd/UtoEzE811fD0dK3 pldQWdXwEWZwrqX2Va12V60Iq+sl/Q32thLWZoH1palmdzoFuXF9NPAA3KnI4MdxJ/cICX N293xnqLw7VJP3ngMMfKhs2BJ6YrdVK0VvTN75LzHuleKLa3vL828TZAfWFXJv0PkeStgX 3lsjyhjNSueD37+A4cuPEvRY6gcvUK0RTCJsfdADQV8D7/IKMKgqfnbRH3Qjqg== 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=c3d9c63329a8b70a0a3b139c7819ace13aab6716 commit c3d9c63329a8b70a0a3b139c7819ace13aab6716 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-12-27 18:29:50 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-12-27 18:29:50 +0000 kldxref: add R_PPC64_ADDR64 handler Implements R_PPC64_ADDR64 handler for kldxref, addressing "kldxref: unhandled relocation type 38" when running "kldxref /boot/kernel" Reviewed by: jhibbits MFC after: 1 week Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D33615 --- usr.sbin/kldxref/ef_powerpc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/kldxref/ef_powerpc.c b/usr.sbin/kldxref/ef_powerpc.c index 4bb2792e0ecf..c50f518f892e 100644 --- a/usr.sbin/kldxref/ef_powerpc.c +++ b/usr.sbin/kldxref/ef_powerpc.c @@ -55,7 +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; - Elf_Size rtype; + Elf_Size rtype, symidx; const Elf_Rela *rela; if (reltype != EF_RELOC_RELA) @@ -65,6 +65,7 @@ ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, where = (Elf_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); if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len) return (0); @@ -73,6 +74,9 @@ 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 */ + *where = EF_SYMADDR(ef, symidx) + addend; + break; default: warnx("unhandled relocation type %" PRI_ELF_SIZE, rtype); }