about summary refs log tree commit diff
path: root/elf/reldepmod3.c
blob: e56b19d49910004474ae969d332bb1202fba36cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <dlfcn.h>
#include <stdlib.h>

int
call_me (void)
{
  int (*fp) (void);

  fp = dlsym (RTLD_DEFAULT, "foo");
  if (fp == NULL)
    {
      printf ("cannot get address of foo in global scope: %s\n", dlerror ());
      exit (1);
    }

  return fp () - 42;
}