diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c index 46e604927ac0..c5fd6fe57d34 100644 --- a/lib/csu/common/crtbegin.c +++ b/lib/csu/common/crtbegin.c @@ -30,6 +30,14 @@ __FBSDID("$FreeBSD$"); typedef void (*crt_func)(void); +extern void *__dso_handle __hidden; + +#ifdef SHARED +void *__dso_handle = &__dso_handle; +#else +void *__dso_handle = 0; +#endif + /* * On some architectures and toolchains we may need to call the .dtors. * These are called in the order they are in the ELF file.