Differences

This shows you the differences between two versions of the page.

gsoc:bnx2:fw_elf [2012/06/10 06:36]
dewyatt
gsoc:bnx2:fw_elf [2012/06/10 13:58] (current)
dewyatt
Line 58: Line 58:
Elf_Scn *scn; Elf_Scn *scn;
Elf_Data *data; Elf_Data *data;
- Elf64_Ehdr *ehdr; + Elf32_Ehdr *ehdr; 
- Elf64_Phdr *phdr; + Elf32_Phdr *phdr; 
- Elf64_Shdr *shdr;+ Elf32_Shdr *shdr;
struct bnx2_mips_fw_file fw; struct bnx2_mips_fw_file fw;
struct bnx2_mips_fw_file_entry *entry; struct bnx2_mips_fw_file_entry *entry;
Line 118: Line 118:
return 1; return 1;
} }
- if ( ( ehdr = elf64_newehdr ( e ) ) == NULL ) {+ if ( ( ehdr = elf32_newehdr ( e ) ) == NULL ) {
fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) ); fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) );
return 1; return 1;
Line 127: Line 127:
ehdr->e_version = EV_CURRENT; ehdr->e_version = EV_CURRENT;
ehdr->e_entry = entry->start_addr; ehdr->e_entry = entry->start_addr;
- if ( ( phdr = elf64_newphdr ( e, 1 ) ) == NULL ) {+ if ( ( phdr = elf32_newphdr ( e, 1 ) ) == NULL ) {
fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) ); fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) );
return 1; return 1;
Line 159: Line 159:
data->d_version = EV_CURRENT; data->d_version = EV_CURRENT;
- if ( ( shdr = elf64_getshdr ( scn ) ) == NULL ) {+ if ( ( shdr = elf32_getshdr ( scn ) ) == NULL ) {
fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) ); fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) );
return 1; return 1;
Line 197: Line 197:
data->d_version = EV_CURRENT; data->d_version = EV_CURRENT;
- if ( ( shdr = elf64_getshdr ( scn ) ) == NULL ) {+ if ( ( shdr = elf32_getshdr ( scn ) ) == NULL ) {
fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) ); fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) );
return 1; return 1;
Line 236: Line 236:
data->d_version = EV_CURRENT; data->d_version = EV_CURRENT;
- if ( ( shdr = elf64_getshdr ( scn ) ) == NULL ) {+ if ( ( shdr = elf32_getshdr ( scn ) ) == NULL ) {
fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) ); fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) );
return 1; return 1;
Line 261: Line 261:
data->d_version = EV_CURRENT; data->d_version = EV_CURRENT;
- if ( ( shdr = elf64_getshdr ( scn ) ) == NULL ) {+ if ( ( shdr = elf32_getshdr ( scn ) ) == NULL ) {
fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) ); fprintf ( stderr, "libelf error: %s\n", elf_errmsg ( -1 ) );
return 1; return 1;
Line 278: Line 278:
phdr->p_type = PT_PHDR; phdr->p_type = PT_PHDR;
phdr->p_offset = ehdr->e_phoff; phdr->p_offset = ehdr->e_phoff;
- phdr->p_filesz = elf64_fsize ( ELF_T_PHDR, 1, EV_CURRENT );+ phdr->p_filesz = elf32_fsize ( ELF_T_PHDR, 1, EV_CURRENT );
phdr->p_vaddr = 0x8000000; phdr->p_vaddr = 0x8000000;
elf_flagphdr ( e, ELF_C_SET, ELF_F_DIRTY ); elf_flagphdr ( e, ELF_C_SET, ELF_F_DIRTY );
 
gsoc/bnx2/fw_elf.txt · Last modified: 2012/06/10 13:58 by dewyatt
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL http://ipxe.org
References to "iPXE" may not be altered or removed.