Back to index

glibc  2.9
Defines | Functions
ldsodefs.h File Reference

Go to the source code of this file.

Defines

#define DL_ADDR_SYM_MATCH(L, SYM, MATCHSYM, ADDR)   _dl_ppc64_addr_sym_match (L, SYM, MATCHSYM, ADDR)

Functions

static __always_inline bool _dl_ppc64_is_opd_sym (const struct link_map *l, const ElfW(Sym)*sym)
static __always_inline bool _dl_ppc64_addr_sym_match (const struct link_map *l, const ElfW(Sym)*sym, const ElfW(Sym)*matchsym, ElfW(Addr) addr)

Define Documentation

#define DL_ADDR_SYM_MATCH (   L,
  SYM,
  MATCHSYM,
  ADDR 
)    _dl_ppc64_addr_sym_match (L, SYM, MATCHSYM, ADDR)

Definition at line 74 of file ldsodefs.h.


Function Documentation

static __always_inline bool _dl_ppc64_addr_sym_match ( const struct link_map l,
const ElfW(Sym)*  sym,
const ElfW(Sym)*  matchsym,
ElfW(Addr)  addr 
) [static]

Definition at line 37 of file ldsodefs.h.

{
  ElfW(Addr) value = l->l_addr + sym->st_value;
  if (_dl_ppc64_is_opd_sym (l, sym))
    {
      if (addr < value || addr >= value + 24)
       {
         value = *(ElfW(Addr) *) value;
         if (addr < value || addr >= value + sym->st_size)
           return false;
       }
    }
  else if (sym->st_shndx == SHN_UNDEF || sym->st_size == 0)
    {
      if (addr != value)
       return false;
    }
  else if (addr < value || addr >= value + sym->st_size)
    return false;

  if (matchsym == NULL)
    return true;

  ElfW(Addr) matchvalue = l->l_addr + matchsym->st_value;
  if (_dl_ppc64_is_opd_sym (l, matchsym)
      && (addr < matchvalue || addr > matchvalue + 24))
    matchvalue = *(ElfW(Addr) *) matchvalue;

  return matchvalue < value;
}

Here is the call graph for this function:

static __always_inline bool _dl_ppc64_is_opd_sym ( const struct link_map l,
const ElfW(Sym)*  sym 
) [static]

Definition at line 28 of file ldsodefs.h.

{
  return (ELFW(ST_TYPE) (sym->st_info) == STT_FUNC
         && l->l_addr + sym->st_value >= (ElfW(Addr)) l->l_ld
         && l->l_addr + sym->st_value < l->l_map_end
         && sym->st_size != 0);
}

Here is the caller graph for this function: