FreeBSD/usr.bin/elfdump/elfdump.c
/*
 * Helpers for ELF files with shnum or shstrndx values that don't fit in the
 * ELF header.  If the values are too large then an escape value is used to
 * indicate that the actual value is found in one of section 0's fields.
 */
Helpers for ELF files with shnum or shstrndx values that don't fit in the
ELF header.  If the values are too large then an escape value is used to
indicate that the actual value is found in one of section 0's fields.
Helpers for ELF files with shnum or shstrndx values that don ' t fit in the ELF header . If the values are too large then an escape value is used to indicate that the actual value is found in one of section 0 ' s fields .
static uint64_t
elf_get_shnum(Elf32_Ehdr *e, void *sh)
{
	uint64_t shnum;
	shnum = elf_get_quarter(e, e, E_SHNUM);
	if (shnum == 0)
		shnum = elf_get_word(e, (char *)sh, SH_SIZE);
	return shnum;
}
static uint64_t elf_get_shnum ( Elf32_Ehdr * e , void * sh ) { uint64_t shnum ; shnum = elf_get_quarter ( e , e , E_SHNUM ) ; if ( shnum == 0 ) shnum = elf_get_word ( e , ( char * ) sh , SH_SIZE ) ; return shnum ; }
Helpers for ELF files with shnum or shstrndx values that don't fit in the
 ELF header.
Helpers for ELF files with shnum or shstrndx values that don ' t fit in the ELF header .