git: 05996f453de2 - main - kldxref: Don't warn and skip file if no relocations are found

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Tue, 10 Sep 2024 17:56:55 UTC
The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=05996f453de2f2c7a03437a492d9d53831fccb2e

commit 05996f453de2f2c7a03437a492d9d53831fccb2e
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2024-09-10 17:56:22 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2024-09-10 17:56:22 +0000

    kldxref: Don't warn and skip file if no relocations are found
    
    This case is hit for the kernel itself on riscv64, and did not used to
    be checked. Since the code here can already handle missing Elf_Rel
    and/or Elf_Rela just delete the check.
    
    Reviewed by:    jhb, imp
    Fixes:          0299afdff145 ("kldxref: Make use of libelf to be a portable cross tool")
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D46517
---
 usr.sbin/kldxref/ef.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c
index 77ddada946f2..975626e46046 100644
--- a/usr.sbin/kldxref/ef.c
+++ b/usr.sbin/kldxref/ef.c
@@ -364,11 +364,6 @@ ef_parse_dynamic(elf_file_t ef, const GElf_Phdr *phdyn)
 		error = EFTYPE;
 		goto out;
 	}
-	if (rel_off == 0 && rela_off == 0) {
-		warnx("%s: no ELF relocation table found\n", ef->ef_name);
-		error = EFTYPE;
-		goto out;
-	}
 
 	nsym = 0;
 	for (i = 0; i < nshdr; i++) {