Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Mar 2010 19:35:17 -0700
From:      Patrick Mahan <mahan@mahan.org>
To:        freebsd-hackers@freebsd.org
Subject:   Using __attribute__((weak)) in the kernel
Message-ID:  <4BA97A65.10507@mahan.org>

next in thread | raw e-mail | index | archive | help
All,

Has anyone used the "weak" function attribute in the kernel?

I have some modules providing APIs that I want to allow them to be either
loaded via kldload or directly built in the kernel.  However, the API functions
are being referenced by code that cannot (at this time) be moved out of the
kernel.  If I understand the use of the "weak" attribute, I should be able to
define these functions as "weak" and they should be over-written either by
the real code functions at kernel link or when kldload() is called.

Or am I mis-understanding the use of this attribute?

Thanks,

Patrick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BA97A65.10507>