Lines Matching refs:ElfHandle
32 u16 ELi_LoadObject2( ELHandle* ElfHandle, void* obj_offset, void* buf) argument
51 if( ElfHandle->process != EL_INITIALIZED) {
59 ElfHandle->ELi_ReadStub( &(ElfHandle->CurrentEhdr), ElfHandle->FileStruct,
60 (u32)(ElfHandle->ar_head), (u32)(obj_offset), sizeof( Elf32_Ehdr));
63 ElfHandle->elf_offset = obj_offset;
64 ElfHandle->buf_current = (void*)((u32)buf + sizeof( Elf32_Ehdr));
65 ElfHandle->shentsize = ElfHandle->CurrentEhdr.e_shentsize;
68 shdr_table = (u32*)malloc( 4 * ElfHandle->CurrentEhdr.e_shnum);
72 for( i=0; i<(ElfHandle->CurrentEhdr.e_shnum); i++) {
78 if( ELi_ShdrIsDebug( ElfHandle, i) == TRUE) { /*When it is debugging information*/
87 ELi_GetShdr( ElfHandle, i, &(CurrentShdrEx->Shdr));
93 ELi_GetStrAdr( ElfHandle, ElfHandle->CurrentEhdr.e_shstrndx,
100 …length = ELi_GetStrLen( ElfHandle, ElfHandle->CurrentEhdr.e_shstrndx, CurrentShdrEx->Shdr.sh_name …
107 ELi_GetStrAdr( ElfHandle, ElfHandle->CurrentEhdr.e_shstrndx,
113 if( i == ElfHandle->CurrentEhdr.e_shstrndx){
119 ElfHandle->CurrentEhdr.e_shnum++; //Add special section
145 ElfHandle->ShdrEx = DmyShdrEx.next;
151 for( i=0; i<(ElfHandle->CurrentEhdr.e_shnum); i++) {
153 CurrentShdrEx = ELi_GetShdrExfromList( ElfHandle->ShdrEx, i);
158 u32 load_start = ELi_ALIGN( ((u32)(ElfHandle->buf_current)), 4);
162 for( j=0; j<(ElfHandle->CurrentEhdr.e_shnum - 1); j++) {
170 ElfHandle->buf_current = (void*)(load_start + sh_size);
178 ELi_CopySectionToBuffer( ElfHandle, &(CurrentShdrEx->Shdr));
183 (i == ElfHandle->CurrentEhdr.e_shstrndx)) {
184 strcpy( ElfHandle->buf_current, SPECIAL_SECTION_NAME);
188 ElfHandle->buf_current += (strlen( SPECIAL_SECTION_NAME) + 1);
200 buf_shdr = ELi_ALIGN( ((u32)(ElfHandle->buf_current)), 4);
201 ElfHandle->buf_current = (void*)buf_shdr;
209 for( i=0; i<(ElfHandle->CurrentEhdr.e_shnum); i++) {
213 CurrentShdrEx = ELi_GetShdrExfromList( ElfHandle->ShdrEx, i);
226 ElfHandle->process = EL_COPIED;
229 ElfHandle->newelf_size = (buf_shdr - (u32)buf) + (section_num*sizeof( Elf32_Shdr));
233 …ElfHandle->CurrentEhdr.e_shnum = section_num; /*Apply the increased section count to the ELF heade…
235 ElfHandle->CurrentEhdr.e_shoff = newelf_shoff;
236 …memcpy( (u8*)buf, &(ElfHandle->CurrentEhdr), sizeof( Elf32_Ehdr)); /*Copy ELF header to the stripp…
240 CurrentShdrEx = ElfHandle->ShdrEx;
248 ElfHandle->ShdrEx = NULL;
256 return (ElfHandle->process);