FreeBSD/contrib/binutils/bfd/elf.c
/* Look up a symbol name.  */
Look up a symbol name.
Look up a symbol name .
const char *
bfd_elf_sym_name (bfd *abfd,
		  Elf_Internal_Shdr *symtab_hdr,
		  Elf_Internal_Sym *isym,
		  asection *sym_sec)
{
  const char *name;
  unsigned int iname = isym->st_name;
  unsigned int shindex = symtab_hdr->sh_link;
  if (iname == 0 && ELF_ST_TYPE (isym->st_info) == STT_SECTION
      && isym->st_shndx < elf_numsections (abfd)
      && !(isym->st_shndx >= SHN_LORESERVE && isym->st_shndx <= SHN_HIRESERVE))
    {
      iname = elf_elfsections (abfd)[isym->st_shndx]->sh_name;
      shindex = elf_elfheader (abfd)->e_shstrndx;
    }
  name = bfd_elf_string_from_elf_section (abfd, shindex, iname);
  if (name == NULL)
    name = "(null)";
  else if (sym_sec && *name == '\0')
    name = bfd_section_name (abfd, sym_sec);
  return name;
}
const char * bfd_elf_sym_name ( bfd * abfd , Elf_Internal_Shdr * symtab_hdr , Elf_Internal_Sym * isym , asection * sym_sec ) { const char * name ; unsigned int iname = isym -> st_name ; unsigned int shindex = symtab_hdr -> sh_link ; if ( iname == 0 && ELF_ST_TYPE ( isym -> st_info ) == STT_SECTION && isym -> st_shndx < elf_numsections ( abfd ) && ! ( isym -> st_shndx >= SHN_LORESERVE && isym -> st_shndx <= SHN_HIRESERVE ) ) { iname = elf_elfsections ( abfd ) [ isym -> st_shndx ] -> sh_name ; shindex = elf_elfheader ( abfd ) -> e_shstrndx ; } name = bfd_elf_string_from_elf_section ( abfd , shindex , iname ) ; if ( name == NULL ) name = " " ; else if ( sym_sec && * name == ' \0 ' ) name = bfd_section_name ( abfd , sym_sec ) ; return name ; }
Look up a symbol name.
Look up a symbol name .
/* Check for a bogus st_shndx to avoid crashing.  */