+static void *dlsym_function(char const *name) noinline;
+/* Load the function name using dlsym() and return it. Terminate program on
+ * failure. Split in function and macro to reduce code inserted into the
+ * function using the macro. */
+static void *dlsym_function(char const *name) {
+ void *result;
+
+ int saved_errno = errno; /* just in case */
+
+ /* Clear possibly existing error. */
+ dlerror();
+ result = dlsym(RTLD_NEXT, name);
+ /* Not much we can do. Most likely the other output functions failed to
+ * load too. */
+ if (dlerror() != NULL) {
+ abort();
+ }
+
+ errno = saved_errno;
+ return result;
+}