mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
fix stripdebug
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@189 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
177653d5b4
commit
00f83c526a
@ -7,9 +7,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static int endian;
|
static int endian;
|
||||||
static BOOL load_strndx_done = FALSE;
|
//static BOOL load_strndx_done = FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*---------------------------------------------------------
|
/*---------------------------------------------------------
|
||||||
バイトデータを読み出す
|
バイトデータを読み出す
|
||||||
--------------------------------------------------------*/
|
--------------------------------------------------------*/
|
||||||
@ -23,6 +24,7 @@ static u8 *load_elf32_byte(u8 *dest, u8 *org, int lsb)
|
|||||||
|
|
||||||
return temp_ptr;
|
return temp_ptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*---------------------------------------------------------
|
/*---------------------------------------------------------
|
||||||
ハーフワードデータを読み出す
|
ハーフワードデータを読み出す
|
||||||
@ -47,6 +49,7 @@ static u8 *load_elf32_half(Elf32_Half *dest, u8 *org, int lsb)
|
|||||||
return (void *)temp_ptr;
|
return (void *)temp_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*---------------------------------------------------------
|
/*---------------------------------------------------------
|
||||||
ワードデータを読み出す
|
ワードデータを読み出す
|
||||||
--------------------------------------------------------*/
|
--------------------------------------------------------*/
|
||||||
@ -107,6 +110,7 @@ static u8 *load_elf32_word(Elf32_Word *dest, u8 *org, int lsb)
|
|||||||
}
|
}
|
||||||
return (void *)temp_ptr;
|
return (void *)temp_ptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*---------------------------------------------------------
|
/*---------------------------------------------------------
|
||||||
ELFヘッダを読み出す
|
ELFヘッダを読み出す
|
||||||
@ -247,7 +251,7 @@ void *ELF_LoadELFHeader(const void *buf, Elf32_Ehdr *ehdr)
|
|||||||
return file_ptr;
|
return file_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*---------------------------------------------------------
|
/*---------------------------------------------------------
|
||||||
Relocation Entry Load
|
Relocation Entry Load
|
||||||
--------------------------------------------------------*/
|
--------------------------------------------------------*/
|
||||||
@ -335,6 +339,6 @@ static void *ELF_LoadSectionHeader(const void *buf,Elf32_Shdr *shdr)
|
|||||||
|
|
||||||
return file_ptr;
|
return file_ptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -199,15 +199,17 @@ u16 ELi_LoadLibrary( ELHandle* ElfHandle, void* obj_image, u32 obj_len, void* bu
|
|||||||
newarch_size += 8;
|
newarch_size += 8;
|
||||||
|
|
||||||
|
|
||||||
ElfHandle->buf_current = new_image_pointer;
|
ElfHandle->buf_current = (void*)new_image_pointer;
|
||||||
while( image_pointer < obj_len) {
|
while( image_pointer < obj_len) {
|
||||||
|
ElfHandle->ELi_ReadStub( &ArHdr, ElfHandle->FileStruct, (u32)(obj_image), image_pointer, arch_size);
|
||||||
ElfHandle->ELi_ReadStub( OBJMAG, ElfHandle->FileStruct, (u32)(obj_image), (image_pointer+arch_size), 4); /*OBJの文字列を取得*/
|
ElfHandle->ELi_ReadStub( OBJMAG, ElfHandle->FileStruct, (u32)(obj_image), (image_pointer+arch_size), 4); /*OBJの文字列を取得*/
|
||||||
if( strncmp( OBJMAG, ELFMAG, 4) == 0) {
|
if( strncmp( OBJMAG, ELFMAG, 4) == 0) {
|
||||||
elf_num++;
|
elf_num++;
|
||||||
ElfHandle->ELi_ReadStub( new_image_pointer, ElfHandle->FileStruct, (u32)(obj_image),
|
|
||||||
image_pointer, arch_size); //arヘッダをstripped elfにコピー
|
memcpy( (void*)new_image_pointer, (const void*)&ArHdr, arch_size); //arヘッダをstripped elfにコピー
|
||||||
|
|
||||||
result = ELi_LoadObject( ElfHandle, (void*)(image_pointer+arch_size),
|
result = ELi_LoadObject( ElfHandle, (void*)(image_pointer+arch_size),
|
||||||
new_image_pointer + arch_size);
|
(void*)(new_image_pointer + arch_size));
|
||||||
// (ElfHandle->buf_current + arch_size));
|
// (ElfHandle->buf_current + arch_size));
|
||||||
|
|
||||||
ELi_SetDecSize( (char*)(((ArchHdr*)new_image_pointer)->ar_size), ElfHandle->newelf_size); //archヘッダのサイズ更新
|
ELi_SetDecSize( (char*)(((ArchHdr*)new_image_pointer)->ar_size), ElfHandle->newelf_size); //archヘッダのサイズ更新
|
||||||
@ -222,14 +224,17 @@ u16 ELi_LoadLibrary( ELHandle* ElfHandle, void* obj_image, u32 obj_len, void* bu
|
|||||||
ElfHandle->SymEx = NULL;
|
ElfHandle->SymEx = NULL;
|
||||||
ElfHandle->process = EL_INITIALIZED; /*フラグの設定*/
|
ElfHandle->process = EL_INITIALIZED; /*フラグの設定*/
|
||||||
}else{
|
}else{
|
||||||
ElfHandle->ELi_ReadStub( new_image_pointer, ElfHandle->FileStruct, (u32)(obj_image),
|
memcpy( (void*)new_image_pointer, (const void*)&ArHdr, arch_size); //arヘッダをstripped elfにコピー
|
||||||
image_pointer, arch_size+AR_GetEntrySize( &ArHdr)); //arヘッダとエントリをstripped elfにコピー
|
|
||||||
|
/*arヘッダの次(エントリ本体)をstripped elfにコピー*/
|
||||||
|
ElfHandle->ELi_ReadStub( (void*)(new_image_pointer+arch_size), ElfHandle->FileStruct,
|
||||||
|
(u32)(obj_image),
|
||||||
|
(image_pointer+arch_size), AR_GetEntrySize( &ArHdr));
|
||||||
|
|
||||||
new_image_pointer += (AR_GetEntrySize( &ArHdr) + arch_size);
|
new_image_pointer += (AR_GetEntrySize( &ArHdr) + arch_size);
|
||||||
newarch_size += (AR_GetEntrySize( &ArHdr) + arch_size);
|
newarch_size += (AR_GetEntrySize( &ArHdr) + arch_size);
|
||||||
}
|
}
|
||||||
/*次のエントリへ*/
|
/*次のエントリへ*/
|
||||||
ElfHandle->ELi_ReadStub( &ArHdr, ElfHandle->FileStruct, (u32)(obj_image), image_pointer, arch_size);
|
|
||||||
image_pointer += arch_size + AR_GetEntrySize( &ArHdr);
|
image_pointer += arch_size + AR_GetEntrySize( &ArHdr);
|
||||||
}
|
}
|
||||||
ElfHandle->newelf_size = newarch_size;
|
ElfHandle->newelf_size = newarch_size;
|
||||||
@ -258,20 +263,19 @@ u16 ELi_LoadLibrary( ELHandle* ElfHandle, void* obj_image, u32 obj_len, void* bu
|
|||||||
u16 ELi_LoadObject( ELHandle* ElfHandle, void* obj_offset, void* buf)
|
u16 ELi_LoadObject( ELHandle* ElfHandle, void* obj_offset, void* buf)
|
||||||
{
|
{
|
||||||
u16 i, j;
|
u16 i, j;
|
||||||
u32 num_of_entry;
|
// u32 num_of_entry;
|
||||||
ELShdrEx* FwdShdrEx;
|
ELShdrEx* FwdShdrEx;
|
||||||
ELShdrEx* CurrentShdrEx;
|
ELShdrEx* CurrentShdrEx;
|
||||||
ELShdrEx DmyShdrEx;
|
ELShdrEx DmyShdrEx;
|
||||||
char sym_str[128]; //デバッグプリント用
|
// char sym_str[128]; //デバッグプリント用
|
||||||
u32 offset; //デバッグプリント用
|
// u32 offset; //デバッグプリント用
|
||||||
u32 newelf_shoff = 0; //stripped elfイメージへの書き込みポインタ
|
u32 newelf_shoff = 0; //stripped elfイメージへの書き込みポインタ
|
||||||
u32 buf_shdr;
|
u32 buf_shdr;
|
||||||
u32 section_num = 0;
|
u32 section_num = 0;
|
||||||
u32 newelf_size;
|
// u32 newelf_size;
|
||||||
u32 tmp_buf;
|
u32 tmp_buf;
|
||||||
u32 *shdr_table; //セクションヘッダ新旧番号対応テーブル
|
u32 *shdr_table; //セクションヘッダ新旧番号対応テーブル
|
||||||
u32 *sym_table; //シンボルエントリ新旧番号対応テーブル
|
// u32 *sym_table; //シンボルエントリ新旧番号対応テーブル
|
||||||
|
|
||||||
/* ELHandleの初期化チェック */
|
/* ELHandleの初期化チェック */
|
||||||
if( ElfHandle->process != EL_INITIALIZED) {
|
if( ElfHandle->process != EL_INITIALIZED) {
|
||||||
return EL_FAILED;
|
return EL_FAILED;
|
||||||
@ -286,13 +290,12 @@ u16 ELi_LoadObject( ELHandle* ElfHandle, void* obj_offset, void* buf)
|
|||||||
|
|
||||||
/* セクションハンドル構築 */
|
/* セクションハンドル構築 */
|
||||||
ElfHandle->elf_offset = obj_offset;
|
ElfHandle->elf_offset = obj_offset;
|
||||||
ElfHandle->buf_current = (u32)buf + sizeof( Elf32_Ehdr);
|
ElfHandle->buf_current = (void*)((u32)buf + sizeof( Elf32_Ehdr));
|
||||||
ElfHandle->shentsize = ElfHandle->CurrentEhdr.e_shentsize;
|
ElfHandle->shentsize = ElfHandle->CurrentEhdr.e_shentsize;
|
||||||
|
|
||||||
/*セクションヘッダテーブル構築*/
|
/*セクションヘッダテーブル構築*/
|
||||||
shdr_table = (u32*)malloc( 4 * ElfHandle->CurrentEhdr.e_shnum);
|
shdr_table = (u32*)malloc( 4 * ElfHandle->CurrentEhdr.e_shnum);
|
||||||
|
|
||||||
|
|
||||||
/*---------- ELShdrExのリストとshdr_tableを作る ----------*/
|
/*---------- ELShdrExのリストとshdr_tableを作る ----------*/
|
||||||
CurrentShdrEx = &DmyShdrEx;
|
CurrentShdrEx = &DmyShdrEx;
|
||||||
for( i=0; i<(ElfHandle->CurrentEhdr.e_shnum); i++) {
|
for( i=0; i<(ElfHandle->CurrentEhdr.e_shnum); i++) {
|
||||||
@ -393,17 +396,23 @@ u16 ELi_LoadObject( ELHandle* ElfHandle, void* obj_offset, void* buf)
|
|||||||
/*---------------------------------*/
|
/*---------------------------------*/
|
||||||
symbol_num++;
|
symbol_num++;
|
||||||
|
|
||||||
|
if( (CurrentSymEx->Sym.st_shndx != SHN_UNDEF) &&
|
||||||
|
(CurrentSymEx->Sym.st_shndx < SHN_LORESERVE)) {
|
||||||
CurrentSymEx->Sym.st_shndx = shdr_table[CurrentSymEx->Sym.st_shndx]; //シンボルエントリの対象セクション番号更新
|
CurrentSymEx->Sym.st_shndx = shdr_table[CurrentSymEx->Sym.st_shndx]; //シンボルエントリの対象セクション番号更新
|
||||||
|
}
|
||||||
CurrentSymEx = CurrentSymEx->next;
|
CurrentSymEx = CurrentSymEx->next;
|
||||||
}/*-------------------------------------*/
|
}/*-------------------------------------*/
|
||||||
|
|
||||||
/*--- シンボルテーブルセクションヘッダの更新 ---*/
|
/*--- シンボルテーブルセクションヘッダの更新 ---*/
|
||||||
CurrentShdrEx->loaded_adr = ELi_CopySymToBuffer( ElfHandle);
|
CurrentShdrEx->loaded_adr = (u32)(ELi_CopySymToBuffer( ElfHandle));
|
||||||
|
if( (CurrentShdrEx->Shdr.sh_link != SHN_UNDEF) &&
|
||||||
|
(CurrentShdrEx->Shdr.sh_link < SHN_LORESERVE)) {
|
||||||
CurrentShdrEx->Shdr.sh_link = shdr_table[CurrentShdrEx->Shdr.sh_link]; //文字列セクション番号更新
|
CurrentShdrEx->Shdr.sh_link = shdr_table[CurrentShdrEx->Shdr.sh_link]; //文字列セクション番号更新
|
||||||
|
}
|
||||||
CurrentShdrEx->Shdr.sh_size = symbol_num * sizeof( Elf32_Sym);
|
CurrentShdrEx->Shdr.sh_size = symbol_num * sizeof( Elf32_Sym);
|
||||||
/*----------------------------------------------*/
|
/*----------------------------------------------*/
|
||||||
}
|
}
|
||||||
ELi_FreeSymList( ElfHandle, CurrentShdrEx->sym_table); //シンボルリスト開放
|
ELi_FreeSymList( ElfHandle, (u32**)(CurrentShdrEx->sym_table)); //シンボルリスト開放
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf( "section %02x relocated at %08x\n",
|
/* printf( "section %02x relocated at %08x\n",
|
||||||
@ -481,7 +490,7 @@ u16 ELi_LoadObject( ELHandle* ElfHandle, void* obj_offset, void* buf)
|
|||||||
|
|
||||||
/*---------- セクションヘッダを stripped elfにコピー ----------*/
|
/*---------- セクションヘッダを stripped elfにコピー ----------*/
|
||||||
buf_shdr = ELi_ALIGN( ((u32)(ElfHandle->buf_current)), 4);
|
buf_shdr = ELi_ALIGN( ((u32)(ElfHandle->buf_current)), 4);
|
||||||
ElfHandle->buf_current = buf_shdr;
|
ElfHandle->buf_current = (void*)buf_shdr;
|
||||||
// printf( "buf_shdr = 0x%x\n", buf_shdr);
|
// printf( "buf_shdr = 0x%x\n", buf_shdr);
|
||||||
// printf( "buf = 0x%x\n", (u32)buf);
|
// printf( "buf = 0x%x\n", (u32)buf);
|
||||||
|
|
||||||
@ -659,10 +668,10 @@ u16 EL_ResolveAllLibrary( void)
|
|||||||
ELAdrEntry* AdrEnt;
|
ELAdrEntry* AdrEnt;
|
||||||
ELUnresolvedEntry* RemoveUnrEnt;
|
ELUnresolvedEntry* RemoveUnrEnt;
|
||||||
ELUnresolvedEntry* UnrEnt;
|
ELUnresolvedEntry* UnrEnt;
|
||||||
ELUnresolvedEntry* CurrentUnrEnt;
|
// ELUnresolvedEntry* CurrentUnrEnt;
|
||||||
ELUnresolvedEntry* FwdUnrEnt;
|
// ELUnresolvedEntry* FwdUnrEnt;
|
||||||
u32 relocation_val;
|
// u32 relocation_val;
|
||||||
ELAdrEntry AddAdrEnt;
|
// ELAdrEntry AddAdrEnt;
|
||||||
char sym_str[128];
|
char sym_str[128];
|
||||||
|
|
||||||
UnrEnt = ELUnrEntStart;
|
UnrEnt = ELUnrEntStart;
|
||||||
@ -683,7 +692,7 @@ u16 EL_ResolveAllLibrary( void)
|
|||||||
// ELi_RemoveUnresolvedEntry( UnrEnt); //解決したので未解決リストから削除
|
// ELi_RemoveUnresolvedEntry( UnrEnt); //解決したので未解決リストから削除
|
||||||
}else{
|
}else{
|
||||||
if( dbg_print_flag == 1) {
|
if( dbg_print_flag == 1) {
|
||||||
printf( "\n static symbol found %s : %8x\n", UnrEnt->sym_str, UnrEnt->S_);
|
printf( "\n static symbol found %s : %8x\n", UnrEnt->sym_str, (int)(UnrEnt->S_));
|
||||||
}
|
}
|
||||||
UnrEnt->AdrEnt = AdrEnt; //見つけたアドレスエントリをセット
|
UnrEnt->AdrEnt = AdrEnt; //見つけたアドレスエントリをセット
|
||||||
UnrEnt->remove_flag = 2; //マーキング(makelstだけで使用する特別な値)
|
UnrEnt->remove_flag = 2; //マーキング(makelstだけで使用する特別な値)
|
||||||
@ -836,7 +845,7 @@ void* EL_GetGlobalAdr( char* ent_name)
|
|||||||
return (void*)(adr);
|
return (void*)(adr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*------------------------------------------------------
|
/*------------------------------------------------------
|
||||||
アドレステーブルを解放する(アプリケーションが登録したエントリまで削除しようとするのでNG)
|
アドレステーブルを解放する(アプリケーションが登録したエントリまで削除しようとするのでNG)
|
||||||
-----------------------------------------------------*/
|
-----------------------------------------------------*/
|
||||||
@ -858,12 +867,14 @@ void* EL_FreeAdrTbl( void)
|
|||||||
}
|
}
|
||||||
/*------------------------------------*/
|
/*------------------------------------*/
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*------------------------------------------------------
|
/*------------------------------------------------------
|
||||||
ELFオブジェクトからデータを読み出すスタブ
|
ELFオブジェクトからデータを読み出すスタブ
|
||||||
-----------------------------------------------------*/
|
-----------------------------------------------------*/
|
||||||
void ELi_ReadFile( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size)
|
void ELi_ReadFile( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size)
|
||||||
{
|
{
|
||||||
|
// printf( "0x%x, 0x%x\n", file_offset, size);
|
||||||
fseek( file_struct, file_offset, SEEK_SET);
|
fseek( file_struct, file_offset, SEEK_SET);
|
||||||
fread( buf, 1, size, file_struct);
|
fread( buf, 1, size, file_struct);
|
||||||
|
|
||||||
|
|||||||
@ -52,12 +52,12 @@ u32 ELi_ALIGN( u32 addr, u32 align_size)
|
|||||||
-----------------------------------------------------*/
|
-----------------------------------------------------*/
|
||||||
void* ELi_CopySymStrToBuffer( ELHandle* ElfHandle, ELShdrEx* SymStrShdrEx)
|
void* ELi_CopySymStrToBuffer( ELHandle* ElfHandle, ELShdrEx* SymStrShdrEx)
|
||||||
{
|
{
|
||||||
u32 load_start, i;
|
u32 load_start;
|
||||||
|
|
||||||
/*アラインメントをとる*/
|
/*アラインメントをとる*/
|
||||||
load_start = ELi_ALIGN( ((u32)(ElfHandle->buf_current)), 4);
|
load_start = ELi_ALIGN( ((u32)(ElfHandle->buf_current)), 4);
|
||||||
|
|
||||||
memcpy( load_start, SymStrShdrEx->str_table, SymStrShdrEx->str_table_size);
|
memcpy( (void*)load_start, SymStrShdrEx->str_table, SymStrShdrEx->str_table_size);
|
||||||
|
|
||||||
/*セクションヘッダのサイズ修正*/
|
/*セクションヘッダのサイズ修正*/
|
||||||
SymStrShdrEx->Shdr.sh_size = SymStrShdrEx->str_table_size;
|
SymStrShdrEx->Shdr.sh_size = SymStrShdrEx->str_table_size;
|
||||||
@ -87,7 +87,7 @@ void* ELi_CopyShStrToBuffer( ELHandle* ElfHandle, Elf32_Shdr* Shdr)
|
|||||||
if( CurrentShdrEx->debug_flag == 1) {
|
if( CurrentShdrEx->debug_flag == 1) {
|
||||||
}else{
|
}else{
|
||||||
CurrentShdrEx->Shdr.sh_name = total_size;
|
CurrentShdrEx->Shdr.sh_name = total_size;
|
||||||
strcpy( load_start+total_size, CurrentShdrEx->str);
|
strcpy( (void*)(load_start+total_size), CurrentShdrEx->str);
|
||||||
total_size += (strlen( CurrentShdrEx->str) + 1);
|
total_size += (strlen( CurrentShdrEx->str) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,6 +292,7 @@ void ELi_BuildSymList( ELHandle* elElfDesc, u32 symsh_index, u32** sym_table)
|
|||||||
|
|
||||||
/*シンボルエントリをコピー*/
|
/*シンボルエントリをコピー*/
|
||||||
ELi_GetEntry( elElfDesc, &SymShdr, i, &TestSym);
|
ELi_GetEntry( elElfDesc, &SymShdr, i, &TestSym);
|
||||||
|
|
||||||
/*-- デバッグ情報フラグをセット --*/
|
/*-- デバッグ情報フラグをセット --*/
|
||||||
CurrentShdrEx = ELi_GetShdrExfromList( elElfDesc->ShdrEx, TestSym.st_shndx);
|
CurrentShdrEx = ELi_GetShdrExfromList( elElfDesc->ShdrEx, TestSym.st_shndx);
|
||||||
if( CurrentShdrEx) {
|
if( CurrentShdrEx) {
|
||||||
|
|||||||
@ -52,22 +52,22 @@ u16 unresolved_table_block_flag = 0;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i;
|
||||||
int n;
|
// int n;
|
||||||
int narg;
|
// int narg;
|
||||||
int t;
|
// int t;
|
||||||
FILE *FHp;
|
FILE *FHp;
|
||||||
u32 *elfbuf;
|
// u32 *elfbuf;
|
||||||
u32* newelfbuf;
|
u32* newelfbuf;
|
||||||
u32 elfsize;
|
u32 elfsize;
|
||||||
u32 mainp_malloc_size, subp_malloc_size;
|
// u32 mainp_malloc_size, subp_malloc_size;
|
||||||
size_t filesize;
|
// size_t filesize;
|
||||||
ELHandle ElfH;
|
ELHandle ElfH;
|
||||||
u32 loadstart, loadend, loadsize, ramadr;
|
// u32 loadstart, loadend, loadsize, ramadr;
|
||||||
u32 entry_address, ram_address;
|
// u32 entry_address, ram_address;
|
||||||
u32 sub_loadstart, sub_loadend, sub_loadsize, sub_ramadr;
|
// u32 sub_loadstart, sub_loadend, sub_loadsize, sub_ramadr;
|
||||||
u32 sub_entry_address, sub_ram_address;;
|
// u32 sub_entry_address, sub_ram_address;;
|
||||||
u32 header_buf[DS_ROM_HEADER_SIZE/4];
|
// u32 header_buf[DS_ROM_HEADER_SIZE/4];
|
||||||
char* elf_filename;
|
char* elf_filename;
|
||||||
u32 elf_namesize;
|
u32 elf_namesize;
|
||||||
char* slash_pointer;
|
char* slash_pointer;
|
||||||
@ -122,7 +122,7 @@ int main(int argc, char *argv[])
|
|||||||
fseek( FHp, 0, SEEK_SET);
|
fseek( FHp, 0, SEEK_SET);
|
||||||
newelfbuf = (u32*)malloc( elfsize);
|
newelfbuf = (u32*)malloc( elfsize);
|
||||||
|
|
||||||
printf( "input elf size = 0x%x\n", elfsize);
|
printf( "input elf size = 0x%x\n", (int)elfsize);
|
||||||
|
|
||||||
EL_InitHandle( &ElfH);
|
EL_InitHandle( &ElfH);
|
||||||
result = EL_LoadLibraryfromFile( &ElfH, FHp, newelfbuf);
|
result = EL_LoadLibraryfromFile( &ElfH, FHp, newelfbuf);
|
||||||
@ -163,7 +163,7 @@ int main(int argc, char *argv[])
|
|||||||
exit( 1);
|
exit( 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf( "stripped elf size = 0x%x\n", ElfH.newelf_size);
|
printf( "stripped elf size = 0x%x\n", (int)(ElfH.newelf_size));
|
||||||
fwrite( newelfbuf, 1, ElfH.newelf_size, NewElfFilep);
|
fwrite( newelfbuf, 1, ElfH.newelf_size, NewElfFilep);
|
||||||
|
|
||||||
fclose( NewElfFilep);
|
fclose( NewElfFilep);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user