Back to index

glibc  2.9
dl-symaddr.c File Reference
#include <ldsodefs.h>
#include <dl-machine.h>

Go to the source code of this file.


void * _dl_symbol_address (struct link_map *map, const ElfW(Sym)*ref)

Function Documentation

void* _dl_symbol_address ( struct link_map map,
const ElfW(Sym)*  ref 

Definition at line 24 of file dl-symaddr.c.

  /* Find the "ip" from the "map" and symbol "ref" */
  Elf32_Addr value = (map ? map->l_addr : 0) + ref->st_value;

  /* On hppa, we have to return the pointer to function descriptor.
     This involves an "| 2" to inform $$dyncall that this is a plabel32  */
  if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC){
    return (void *)((unsigned long)_dl_make_fptr (map, ref, value) | 2);
    return (void *) value;