Re: kldxref: /boot/kernel/kernel: no ELF relocation table found

From: Dennis Clarke <dclarke_at_blastwave.org>
Date: Mon, 02 Sep 2024 18:06:13 UTC
On 9/2/24 13:57, Jessica Clarke wrote:
> On 2 Sep 2024, at 11:54, Dennis Clarke <dclarke@blastwave.org> wrote:
>>
>>
>> All:
>>
>>     Ye ol "make installkernel" starts nicely but ends a little odd :
>>
.
.
.  <snip>
.
.
>> kldxref /boot/kernel
>> kldxref: /boot/kernel/kernel: no ELF relocation table found
>>
>> --------------------------------------------------------------
>>>>> Installing kernel GENERIC completed on Mon Sep  2 10:13:55 UTC 2024
>> --------------------------------------------------------------
>>
>>
>>
>>
>> So then ... "no ELF relocation table found"?
>>
>> Looking at https://cgit.freebsd.org/src/tree/usr.sbin/kldxref/ef.c#n220
>> and then downwards to line 367 :
>>
>>     if (rel_off == 0 && rela_off == 0) {
>>         warnx("%s: no ELF relocation table found\n", ef->ef_name);
>>         error = EFTYPE;
>>         goto out;
>>     }
>>
.
.
.  <snip>
.
.
>> So therefore the situation :
>>
>>     ( 1 )  well understood and just a normal red herring[1]
>>
>>     ( 2 )  ignore it
>>
>>     ( 3 )  huh? that's weird. never saw that before.
>>
>> Curious what is going on there.
> 
> It’s a harmless warning from an overly-careful set of checks. The tool
> was refactored and this case went from being ignored to warning. Cc’ing
> jhb@ to remind him of this as I pointed it out a while ago.
> 
> Jess

     Thank you once again !

     So this is a serious case of " ( 2 )  ignore it " for now.

     I figured that the output from readelf -delV was darn similar to
     the previous kernel. So ... yeah ... I ignored it.


     Onwards and upwards and I may even get some docs written up.

--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken