Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Apr 2016 18:43:23 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-i386@FreeBSD.org
Subject:   [Bug 208464] [svr4] svr4.ko fails to load due to not finding symbol svr4_delete_socket even though it is present in same module
Message-ID:  <bug-208464-10-FRmQlvCrD3@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-208464-10@https.bugs.freebsd.org/bugzilla/>
References:  <bug-208464-10@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208464

--- Comment #1 from Kristoffer Eriksson <ske-89@pkmab.se> ---
Created attachment 169112
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D169112&action=
=3Dedit
Patch for dependencies between svr4.ko & streams.ko due to symbols
svr4_delete_socket & svr4_stream_get

This attachment fixes the bug with both svr4.ko & streams.ko complaining ab=
out
undefined symbol svr4_delete_socket. The symbol is present in svr4.ko, but =
was
not found. Additionally fixes the same problem in reverse for the symbol
svr4_stream_get, which was revealed after the first fix. These created a
two-way dependency between the two modules, preventing both of them from be=
ing
loaded.

Moved EXPORT_SYMS=3Dsvr4_delete_socket from modules/streams/Makefile to
modules/svr4/Makefile. The function had already moved from streams.ko to
svr4.ko in revision 160558 in 2006, but EXPORT_SYMS was not updated.

Added MODULE_DEPEND(streams, svr4elf) to dev/streams/streams.c to reflect t=
his,
and a matching MODULE_VERSION to compat/svr4/svr4_sysvec.c. Otherwise
streams.ko still didn't find svr4_delete_socket in svr4.ko.

Moved the function svr4_stream_get() from dev/streams/streams.c to
compat/svr4/svr4_socket.c like svr4_delete_socket() was already moved in 20=
06.
There were no callers in streams.ko, only in svr4.ko. Included svr4_stropts=
.h
to declare it.

Then removed svr4_stream_get too from EXPORT_SYMS in modules/streams/Makefi=
le
for streams.ko. Removed MODULE_DEPEND(svr4elf, streams) from
compat/svr4/svr4_sysvec.c, since no calls from svr4.ko to streams.ko remain=
ed
now. - This dissolves the two-way dependency, leaving only streams.ko depen=
ding
on svr4.ko to call svr4_delete_socket().

(Alternatively svr4_delete_socket() might perhaps have been moved back to
streams.ko, or perhaps even all of svr4_sockets.c could have moved there, or
both modules could just as well have been joined into a single module, like=
 it
was originally in NetBSD.)

Removed EXPORT_SYMS=3Dsvr4_str_initialized, which doesn't exist currently.

The source I patched came from 10.3-RELEASE.

After this I can successfully kldload these modules again.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-208464-10-FRmQlvCrD3>