Back to index

glibc  2.9
Functions | Variables
dl-sym.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
#include <dlfcn.h>
#include <dlldr.h>

Go to the source code of this file.

Functions

void * _dl_sym (void *handle, const char *symbol, void *who)

Variables

int _dl_numso
DL_SODATA_dl_sotable

Function Documentation

void* _dl_sym ( void *  handle,
const char *  symbol,
void *  who 
)

Definition at line 30 of file dl-sym.c.

{
  void *rt_function;

  if ((int) handle < 0 || (int) handle >= _dl_numso || _dl_sotable == NULL)
    {
      errno = EINVAL;
      return NULL;
    }

  switch (_dl_sotable[(int) handle].type)
    {
    case DL_UNIX_SYSCALL:
      rt_function = (void *) __loadx (DL_UNIX_SYSCALL, (void *) symbol);
      break;

    case DL_GETSYM:
      rt_function = (void *) __loadx (DL_GETSYM, (void *) symbol,
                                  _dl_sotable[(int) handle].index,
                                  _dl_sotable[(int) handle].dataorg);
      break;

    default:
      errno = EINVAL;
      return NULL;
    }

  return rt_function;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 29 of file dl-open.c.

Definition at line 30 of file dl-open.c.