From nobody Mon Sep 2 17:57:05 2024 X-Original-To: riscv@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 4WyGg21GG8z5Tp8n for ; Mon, 02 Sep 2024 17:57:18 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyGg16D1mz454D for ; Mon, 2 Sep 2024 17:57:17 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-374bd059b12so1439806f8f.1 for ; Mon, 02 Sep 2024 10:57:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725299836; x=1725904636; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a7CDSCKjZu+YMSfymyzuEkuKVoRzFJHQD5elor68Hyw=; b=PHd8+6eFyukN1DXFekQc6kQGkfzZheqMHz41SynrY5KhXdnBBm6j0fjldHG9QVZ8W+ wo4HJ2qiBVfaVbJlD7W7z7/PJSxh4Pk/PhfkO2c6OyAaBx+h0N7aX+JCKTxE5n/Z85fu TKHFMuxpmdexnDPhM8H52rKMepyW1bvptIk7tDT6yeybzqmZuO1FKzt5IhdCDgkxdo1i el7z5mokINO3mZdZGa8avW0ca5xNn0/zQEXYUuqtTiI71mroAr54IfkAoaqYw5ImKvtl op3TMw8LWx5yGMckvbbF8rr5YL1Wxv0u022paM2tyYzpgRmdNbv9YWSqVgDfkfHBZNPn hXPw== X-Gm-Message-State: AOJu0YysPSZAU4e/XFJDWYQNj2hM7+dzv+g+gL7Khz2a5ABKwekoaMWk 5GFRQiTSgjxyX+wD2tFV3F7VtBVmkSadS4VJVP9cGpFXBgMWsJLLAgA9VATQkGc= X-Google-Smtp-Source: AGHT+IH5tAsrlra/wBgvwAWKrS85bdjN3+ylM2b7GTg5rJEhEBchV3v6RtdzMkBP5Y0zns3SwM86tA== X-Received: by 2002:adf:e88b:0:b0:374:ba3f:ad08 with SMTP id ffacd0b85a97d-374ba3faf72mr4755689f8f.55.1725299836218; Mon, 02 Sep 2024 10:57:16 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-374c554f0c2sm5461404f8f.43.2024.09.02.10.57.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Sep 2024 10:57:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-riscv@freebsd.org Sender: owner-freebsd-riscv@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: kldxref: /boot/kernel/kernel: no ELF relocation table found From: Jessica Clarke In-Reply-To: <8a58b38a-b7fb-494e-a730-e4c341aaa9ee@blastwave.org> Date: Mon, 2 Sep 2024 18:57:05 +0100 Cc: "riscv@freebsd.org" , John Baldwin Content-Transfer-Encoding: quoted-printable Message-Id: <02D984C2-3505-4E61-BC24-21E9E5249F70@freebsd.org> References: <8a58b38a-b7fb-494e-a730-e4c341aaa9ee@blastwave.org> To: Dennis Clarke X-Mailer: Apple Mail (2.3776.700.51) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4WyGg16D1mz454D On 2 Sep 2024, at 11:54, Dennis Clarke wrote: >=20 >=20 > All: >=20 > Ye ol "make installkernel" starts nicely but ends a little odd : >=20 >=20 > e# make installkernel > -------------------------------------------------------------- > >>> Install check kernel > -------------------------------------------------------------- > -------------------------------------------------------------- > >>> Installing kernel GENERIC on Mon Sep 2 10:10:05 UTC 2024 > -------------------------------------------------------------- > cd /usr/obj/usr/src/riscv.riscv64/sys/GENERIC; MACHINE_ARCH=3Driscv64 = MACHINE=3Driscv CPUTYPE=3D CC=3D"cc -target riscv64-unknown-freebsd15.0 = --sysroot=3D/usr/obj/usr/src/riscv.riscv64/tmp = -B/usr/obj/usr/src/riscv.riscv64/tmp/usr/bin" CXX=3D"c++ -target = riscv64-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/riscv.riscv64/tmp= -B/usr/obj/usr/src/riscv.riscv64/tmp/usr/bin" CPP=3D"cpp -target = riscv64-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/riscv.riscv64/tmp= -B/usr/obj/usr/src/riscv.riscv64/tmp/usr/bin" AS=3D"as" AR=3D"ar" = ELFCTL=3D"elfctl" LD=3D"ld" LLVM_LINK=3D"" NM=3Dnm OBJCOPY=3D"objcopy" = RANLIB=3Dranlib STRINGS=3D SIZE=3D"size" STRIPBIN=3D"strip" = PATH=3D/usr/obj/usr/src/riscv.riscv64/tmp/bin:/usr/obj/usr/src/riscv.riscv= 64/tmp/usr/sbin:/usr/obj/usr/src/riscv.riscv64/tmp/usr/bin:/usr/obj/usr/sr= c/riscv.riscv64/tmp/legacy/usr/sbin:/usr/obj/usr/src/riscv.riscv64/tmp/leg= acy/usr/bin:/usr/obj/usr/src/riscv.riscv64/tmp/legacy/bin:/usr/obj/usr/src= /riscv.riscv64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin = make KERNEL=3Dkernel METALOG=3D install > thiskernel=3D`sysctl -n kern.bootfile || echo /boot/kernel/kernel` ; = if [ ! "`dirname "$thiskernel"`" -ef /boot/kernel ] ; then chflags -R = noschg /boot/kernel ; rm -rf /boot/kernel ; rm -rf = /usr/lib/debug/boot/kernel ; else if [ -d /boot/kernel.old ] ; then = chflags -R noschg /boot/kernel.old ; rm -rf /boot/kernel.old ; fi ; = mv /boot/kernel /boot/kernel.old ; if [ -n "/usr/lib/debug" -a -d = /usr/lib/debug/boot/kernel ]; then rm -rf = /usr/lib/debug/boot/kernel.old ; mv /usr/lib/debug/boot/kernel = /usr/lib/debug/boot/kernel.old ; fi ; sysctl = kern.bootfile=3D/boot/kernel.old/"`basename "$thiskernel"`" ; fi > kern.bootfile: /boot/kernel/kernel -> /boot/kernel.old/kernel > mkdir -p /boot/kernel > install -p -m 444 -o root -g wheel kernel /boot/kernel/ > mkdir -p /usr/lib/debug/boot/kernel > install -p -m 444 -o root -g wheel kernel.debug = /usr/lib/debug/boot/kernel/ > cd /usr/src/sys/modules; = MAKEOBJDIRPREFIX=3D/usr/obj/usr/src/riscv.riscv64/sys/GENERIC/modules = KMODDIR=3D/boot/kernel MACHINE_CPUARCH=3Driscv MACHINE=3Driscv = MACHINE_ARCH=3Driscv64 MODULES_EXTRA=3D"dtb/sifive" WITHOUT_MODULES=3D"" = ARCH_FLAGS=3D"" DEBUG_FLAGS=3D"-g" __MPATH=3D"" = KERNBUILDDIR=3D"/usr/obj/usr/src/riscv.riscv64/sys/GENERIC" = SYSDIR=3D"/usr/src/sys" MODULE_TIED=3Dyes WITH_CTF=3D"1" make install > =3D=3D=3D> accf_data (install) > install -T release -o root -g wheel -m 444 accf_data.ko = /boot/kernel/ > install -T dbg -o root -g wheel -m 444 accf_data.ko.debug = /usr/lib/debug/boot/kernel/ > =3D=3D=3D> accf_dns (install) > install -T release -o root -g wheel -m 444 accf_dns.ko /boot/kernel/ > install -T dbg -o root -g wheel -m 444 accf_dns.ko.debug = /usr/lib/debug/boot/kernel/ > . > . > . etc etc etc > . > . > =3D=3D=3D> xz (install) > install -T release -o root -g wheel -m 444 xz.ko /boot/kernel/ > install -T dbg -o root -g wheel -m 444 xz.ko.debug = /usr/lib/debug/boot/kernel/ > =3D=3D=3D> zfs (install) > install -T release -o root -g wheel -m 444 zfs.ko /boot/kernel/ > install -T dbg -o root -g wheel -m 444 zfs.ko.debug = /usr/lib/debug/boot/kernel/ > =3D=3D=3D> zlib (install) > install -T release -o root -g wheel -m 444 zlib.ko /boot/kernel/ > install -T dbg -o root -g wheel -m 444 zlib.ko.debug = /usr/lib/debug/boot/kernel/ > kldxref /boot/kernel > kldxref: /boot/kernel/kernel: no ELF relocation table found >=20 > -------------------------------------------------------------- > >>> Installing kernel GENERIC completed on Mon Sep 2 10:13:55 UTC = 2024 > -------------------------------------------------------------- >=20 >=20 >=20 >=20 > So then ... "no ELF relocation table found"? >=20 > Looking at = https://cgit.freebsd.org/src/tree/usr.sbin/kldxref/ef.c#n220 > and then downwards to line 367 : >=20 > if (rel_off =3D=3D 0 && rela_off =3D=3D 0) { > warnx("%s: no ELF relocation table found\n", ef->ef_name); > error =3D EFTYPE; > goto out; > } >=20 > Which makes me wonder about the ( I hope ) harmless output from this : >=20 >=20 > # kldxref -dv /boot/kernel > /boot/kernel/accf_data.ko > module accf_data > depends on kernel.1500023 (1500023,1500023) > interface accf_data.1 > /boot/kernel/accf_dns.ko > module accf_dns > depends on kernel.1500023 (1500023,1500023) > interface accf_dns.1 > . > . > . > /boot/kernel/kern_testfrwk.ko > module kern_testframework > interface kern_testframework.1 > depends on kernel.1500023 (1500023,1500023) > /boot/kernel/kernel > kldxref: /boot/kernel/kernel: no ELF relocation table found >=20 > kldxref: /boot/kernel/kernel: not a valid DSO or object file: = Inappropriate file type or format > /boot/kernel/kgssapi.ko > module kgssapi > depends on kernel.1500023 (1500023,1500023) > depends on xdr.1 (1,1) > depends on krpc.1 (1,1) > interface kgssapi.1 > . > . > . >=20 > etc etc >=20 > . > . > . >=20 >=20 >=20 >=20 >=20 > Also I do see this was created : >=20 > e# ls -lapb /boot/kernel/linker.hints > -rw-r--r-- 1 root wheel 212416 Sep 2 10:13 /boot/kernel/linker.hints > e# >=20 > Looking over the output from "readelf -delV /boot/kernel.old/kernel" = as > well as this new kernel they both look very similar. Addresses and = some > other bits changed of course. >=20 > So therefore the situation : >=20 > ( 1 ) well understood and just a normal red herring[1] >=20 > ( 2 ) ignore it >=20 > ( 3 ) huh? that's weird. never saw that before. >=20 > Curious what is going on there. It=E2=80=99s a harmless warning from an overly-careful set of checks. = The tool was refactored and this case went from being ignored to warning. = Cc=E2=80=99ing jhb@ to remind him of this as I pointed it out a while ago. Jess