Skip to content
Permalink
29955b5d96
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
42 lines (33 sloc) 708 Bytes
#include <dlfcn.h>
#include <mcheck.h>
#include <stdio.h>
#include <stdlib.h>
static int
do_test (void)
{
void *h;
int (*fp) (int);
int result;
mtrace ();
h = dlopen ("renamed.so", RTLD_LAZY);
if (h == NULL)
{
printf ("failed to load \"%s\": %s\n", "renamed.so", dlerror ());
exit (1);
}
fp = dlsym (h, "in_renamed");
if (fp == NULL)
{
printf ("lookup of \"%s\" failed: %s\n", "in_renamed", dlerror ());
exit (1);
}
result = fp (10);
if (dlclose (h) != 0)
{
printf ("failed to close \"%s\": %s\n", "renamed.so", dlerror ());
exit (1);
}
return result;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"