Skip to content

Commit

Permalink
Revert "libkldelf: add a private library for kernel/kld-related ELF p…
Browse files Browse the repository at this point in the history
…arsing"

This reverts commit 0a2cfd6.
  • Loading branch information
khng300 committed Oct 8, 2024
1 parent 7007de7 commit 50c64df
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 67 deletions.
11 changes: 2 additions & 9 deletions Makefile.inc1
Original file line number Diff line number Diff line change
Expand Up @@ -2509,12 +2509,8 @@ ${_bt}-lib/libdwarf: ${_bt_m4_depend}
_bt_libelf_depend=${_bt}-lib/libelf
.endif

_libkldelf= lib/libkldelf
${_bt}-lib/libkldelf: ${_bt_libelf_depend}
_bt_libkldelf_depend=${_bt}-lib/libkldelf

_kldxref= usr.sbin/kldxref
${_bt}-usr.sbin/kldxref: ${_bt_libelf_depend} ${_bt_libkldelf_depend}
${_bt}-usr.sbin/kldxref: ${_bt_libelf_depend}

# flua is required to regenerate syscall files. It first appeared during the
# 13.0-CURRENT cycle, thus needs to be built on -older releases and stable
Expand Down Expand Up @@ -2777,7 +2773,6 @@ bootstrap-tools: ${_bt}-links .PHONY
${_cat} \
${_kbdcontrol} \
${_elftoolchain_libs} \
${_libkldelf} \
${_kldxref} \
lib/libopenbsd \
usr.bin/mandoc \
Expand Down Expand Up @@ -3221,8 +3216,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \
lib/libfigpar \
${_lib_libgssapi} \
lib/libjail \
lib/libkiconv lib/libkldelf lib/libkvm \
lib/liblzma lib/libmd lib/libnv \
lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \
lib/libzstd \
${_lib_casper} \
lib/ncurses/tinfo \
Expand Down Expand Up @@ -3257,7 +3251,6 @@ _prebuild_libs+= lib/libregex
.endif

lib/libgeom__L: lib/libexpat__L lib/libsbuf__L
lib/libkldelf__L: lib/libelf__L
lib/libkvm__L: lib/libelf__L

.if ${MK_RADIUS_SUPPORT} != "no"
Expand Down
1 change: 0 additions & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libiscsiutil \
libjail \
libkiconv \
libkldelf \
libkvm \
liblua \
liblzma \
Expand Down
21 changes: 0 additions & 21 deletions lib/libkldelf/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions lib/libkldelf/Makefile.depend

This file was deleted.

2 changes: 0 additions & 2 deletions share/mk/src.libnames.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ _PRIVATELIBS= \
gtest_main \
heimipcc \
heimipcs \
kldelf \
ldns \
sqlite3 \
ssh \
Expand Down Expand Up @@ -313,7 +312,6 @@ _DP_bsnmp= crypto
.endif
_DP_geom= bsdxml sbuf
_DP_cam= sbuf
_DP_kldelf= elf
_DP_kvm= elf
_DP_casper= nv
_DP_cap_dns= nv
Expand Down
13 changes: 9 additions & 4 deletions usr.sbin/kldxref/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
PACKAGE= runtime
PROG= kldxref
MAN= kldxref.8
SRCS= kldxref.c

CFLAGS+=-I${SRCTOP}/lib/libkldelf
SRCS= kldxref.c ef.c ef_obj.c elf.c
SRCS+= ef_aarch64.c \
ef_arm.c \
ef_amd64.c \
ef_i386.c \
ef_mips.c \
ef_powerpc.c \
ef_riscv.c

WARNS?= 2

LIBADD= elf kldelf
LIBADD= elf

.include <bsd.prog.mk>
2 changes: 1 addition & 1 deletion lib/libkldelf/ef.c → usr.sbin/kldxref/ef.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <stdlib.h>
#include <string.h>

#include "kldelf.h"
#include "ef.h"

#define MAXSEGS 16
struct ef_file {
Expand Down
6 changes: 3 additions & 3 deletions lib/libkldelf/kldelf.h → usr.sbin/kldxref/ef.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
* SUCH DAMAGE.
*/

#ifndef _KLDELF_H_
#define _KLDELF_H_
#ifndef _EF_H_
#define _EF_H_

#include <sys/linker_set.h>
#include <stdbool.h>
Expand Down Expand Up @@ -312,4 +312,4 @@ int elf_reloc(struct elf_file *ef, const void *reldata, Elf_Type reltype,

__END_DECLS

#endif /* _KLDELF_H_*/
#endif /* _EF_H_*/
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <errno.h>
#include <gelf.h>

#include "kldelf.h"
#include "ef.h"

/*
* Apply relocations to the values obtained from the file. `relbase' is the
Expand Down
2 changes: 1 addition & 1 deletion lib/libkldelf/ef_amd64.c → usr.sbin/kldxref/ef_amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <errno.h>
#include <gelf.h>

#include "kldelf.h"
#include "ef.h"

/*
* Apply relocations to the values obtained from the file. `relbase' is the
Expand Down
2 changes: 1 addition & 1 deletion lib/libkldelf/ef_arm.c → usr.sbin/kldxref/ef_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <errno.h>
#include <gelf.h>

#include "kldelf.h"
#include "ef.h"

/*
* Apply relocations to the values obtained from the file. `relbase' is the
Expand Down
2 changes: 1 addition & 1 deletion lib/libkldelf/ef_i386.c → usr.sbin/kldxref/ef_i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <errno.h>
#include <gelf.h>

#include "kldelf.h"
#include "ef.h"

/*
* Apply relocations to the values obtained from the file. `relbase' is the
Expand Down
2 changes: 1 addition & 1 deletion lib/libkldelf/ef_mips.c → usr.sbin/kldxref/ef_mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <errno.h>
#include <gelf.h>

#include "kldelf.h"
#include "ef.h"

/*
* Apply relocations to the values obtained from the file. `relbase' is the
Expand Down
2 changes: 1 addition & 1 deletion lib/libkldelf/ef_obj.c → usr.sbin/kldxref/ef_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <stdlib.h>
#include <string.h>

#include "kldelf.h"
#include "ef.h"

typedef struct {
GElf_Addr addr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <errno.h>
#include <gelf.h>

#include "kldelf.h"
#include "ef.h"

/*
* Apply relocations to the values obtained from the file. `relbase' is the
Expand Down
2 changes: 1 addition & 1 deletion lib/libkldelf/ef_riscv.c → usr.sbin/kldxref/ef_riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <errno.h>
#include <gelf.h>

#include "kldelf.h"
#include "ef.h"

/*
* Apply relocations to the values obtained from the file. `relbase' is the
Expand Down
2 changes: 1 addition & 1 deletion lib/libkldelf/elf.c → usr.sbin/kldxref/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <string.h>
#include <unistd.h>

#include "kldelf.h"
#include "ef.h"

SET_DECLARE(elf_reloc, struct elf_reloc_data);

Expand Down
2 changes: 1 addition & 1 deletion usr.sbin/kldxref/kldxref.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <string.h>
#include <unistd.h>

#include <kldelf.h>
#include "ef.h"

#define MAXRECSIZE (64 << 10) /* 64k */
#define check(val) if ((error = (val)) != 0) break
Expand Down

0 comments on commit 50c64df

Please sign in to comment.