Back to index

glibc  2.9
dl-vdso.c File Reference
#include "config.h"
#include <ldsodefs.h>

Go to the source code of this file.


void *internal_function _dl_vdso_vsym (const char *name, const struct r_found_version *vers)

Function Documentation

void* internal_function _dl_vdso_vsym ( const char *  name,
const struct r_found_version vers 

Definition at line 26 of file dl-vdso.c.

  struct link_map *map = GLRO (dl_sysinfo_map);
  void *value = NULL;

  if (map != NULL)
      /* Use a WEAK REF so we don't error out if the symbol is not found.  */
      ElfW (Sym) wsym;
      memset (&wsym, 0, sizeof (ElfW (Sym)));
      wsym.st_info = (unsigned char) ELFW (ST_INFO (STB_WEAK, STT_NOTYPE));

      /* Search the scope of the vdso map.  */
      const ElfW (Sym) *ref = &wsym;
      lookup_t result = GLRO (dl_lookup_symbol_x) (name, map, &ref,
                                             vers, 0, 0, NULL);

      if (ref != NULL)
       value = DL_SYMBOL_ADDRESS (result, ref);

  return value;