mock: mark wrappers "used" so LTO will keep them
Fixes the build with CONFIG_LTO=y. Change-Id: I3acbdd16c5ff44f50747644c09ca7b0228c790cc Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/396449 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
f6f434b4b4
commit
f22907768a
@ -68,7 +68,7 @@
|
|||||||
/* for defining the implmentation of wrappers for syscalls */
|
/* for defining the implmentation of wrappers for syscalls */
|
||||||
#define DEFINE_WRAPPER(fn, ret, dargs, pargs, val) \
|
#define DEFINE_WRAPPER(fn, ret, dargs, pargs, val) \
|
||||||
ret ut_ ## fn = val; \
|
ret ut_ ## fn = val; \
|
||||||
ret __wrap_ ## fn dargs \
|
__attribute__((used)) ret __wrap_ ## fn dargs \
|
||||||
{ \
|
{ \
|
||||||
if (ut_ ## fn == (ret)MOCK_PASS_THRU) { \
|
if (ut_ ## fn == (ret)MOCK_PASS_THRU) { \
|
||||||
return __real_ ## fn pargs; \
|
return __real_ ## fn pargs; \
|
||||||
|
Loading…
Reference in New Issue
Block a user