Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/elftoolchain/libelf/gelf_mips64el.c
Show All 28 Lines | |||||
#include "_libelf.h" | #include "_libelf.h" | ||||
ELFTC_VCSID("$Id$"); | ELFTC_VCSID("$Id$"); | ||||
int | int | ||||
_libelf_is_mips64el(Elf *e) | _libelf_is_mips64el(Elf *e) | ||||
{ | { | ||||
return (e->e_kind == ELF_K_ELF && e->e_byteorder == ELFDATA2LSB && | return (e->e_kind == ELF_K_ELF && | ||||
e->e_u.e_elf.e_ehdr.e_ehdr64->e_machine == EM_MIPS); | e->e_u.e_elf.e_ehdr.e_ehdr64->e_machine == EM_MIPS && | ||||
e->e_u.e_elf.e_ehdr.e_ehdr64->e_ident[EI_DATA] == ELFDATA2LSB); | |||||
} | } | ||||
/* | /* | ||||
* For MIPS64, the r_info field is actually stored as a 32-bit symbol | * For MIPS64, the r_info field is actually stored as a 32-bit symbol | ||||
* index (r_sym) followed by four single-byte fields (r_ssym, r_type3, | * index (r_sym) followed by four single-byte fields (r_ssym, r_type3, | ||||
* r_type2, and r_type). The byte-swap for the little-endian case | * r_type2, and r_type). The byte-swap for the little-endian case | ||||
* jumbles this incorrectly so compensate. | * jumbles this incorrectly so compensate. | ||||
*/ | */ | ||||
Show All 35 Lines |