Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2, fix long string mismatch #16

Merged
merged 1 commit into from
Oct 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions elf2cfetbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ void set_st_size(union Elf_Sym *Symbol, uint64_t new_value)
{
Symbol->Sym32.st_size = (uint32_t) new_value;
if (Symbol->Sym32.st_size != new_value) {
printf("ERROR: Sym32.st_size can not hold %ld\n", new_value);
printf("ERROR: Sym32.st_size can not hold %lu\n", new_value);
}
}
else
Expand Down Expand Up @@ -1680,7 +1680,7 @@ int32 GetSectionHeader(int32 SectionIndex, union Elf_Shdr *SectionHeader)
}
SymbolTableEntrySize = get_sh_entsize(SectionHeader);
NumSymbols = (get_sh_size(SectionHeader) / get_sh_entsize(SectionHeader)) - 1;
sprintf(VerboseStr, "SHT_SYMTAB (2) - # Symbols = %ld", NumSymbols);
sprintf(VerboseStr, "SHT_SYMTAB (2) - # Symbols = %lu", NumSymbols);
break;

case SHT_STRTAB:
Expand Down Expand Up @@ -1779,7 +1779,7 @@ int32 GetSymbol(int32 SymbolIndex, union Elf_Sym *Symbol)
int32 i=0;
if (SeekOffset != calculated_offset)
{
printf("Error: SeekOffset may not be %ld\n", calculated_offset);
printf("Error: SeekOffset may not be %lu\n", calculated_offset);
Status = FAILED;
}
else
Expand Down Expand Up @@ -1893,8 +1893,8 @@ void PrintElfHeader32(union Elf_Ehdr ElfHeader)
{
if (Verbose) printf(" e_version = %d\n", get_e_version(&ElfHeader));
if (Verbose) printf(" e_entry = 0x%x\n", ElfHeader.Ehdr32.e_entry);
if (Verbose) printf(" e_phoff = 0x%08x (%d)\n", ElfHeader.Ehdr32.e_phoff, ElfHeader.Ehdr32.e_phoff);
if (Verbose) printf(" e_shoff = 0x%08x (%d)\n", ElfHeader.Ehdr32.e_shoff, ElfHeader.Ehdr32.e_shoff);
if (Verbose) printf(" e_phoff = 0x%08x (%u)\n", ElfHeader.Ehdr32.e_phoff, ElfHeader.Ehdr32.e_phoff);
if (Verbose) printf(" e_shoff = 0x%08x (%u)\n", ElfHeader.Ehdr32.e_shoff, ElfHeader.Ehdr32.e_shoff);
if (Verbose) printf(" e_flags = 0x%08x\n", ElfHeader.Ehdr32.e_flags);
if (Verbose) printf(" e_ehsize = %d\n", ElfHeader.Ehdr32.e_ehsize);
if (Verbose) printf(" e_phentsize = %d\n", ElfHeader.Ehdr32.e_phentsize);
Expand All @@ -1908,8 +1908,8 @@ void PrintElfHeader64(union Elf_Ehdr ElfHeader)
{
if (Verbose) printf(" e_version = %d\n", get_e_version(&ElfHeader));
if (Verbose) printf(" e_entry = 0x%lx\n", ElfHeader.Ehdr64.e_entry);
if (Verbose) printf(" e_phoff = 0x%08lx (%ld)\n", ElfHeader.Ehdr64.e_phoff, ElfHeader.Ehdr64.e_phoff);
if (Verbose) printf(" e_shoff = 0x%08lx (%ld)\n", ElfHeader.Ehdr64.e_shoff, ElfHeader.Ehdr64.e_shoff);
if (Verbose) printf(" e_phoff = 0x%08lx (%lu)\n", ElfHeader.Ehdr64.e_phoff, ElfHeader.Ehdr64.e_phoff);
if (Verbose) printf(" e_shoff = 0x%08lx (%lu)\n", ElfHeader.Ehdr64.e_shoff, ElfHeader.Ehdr64.e_shoff);
if (Verbose) printf(" e_flags = 0x%08x\n", ElfHeader.Ehdr64.e_flags);
if (Verbose) printf(" e_ehsize = %d\n", ElfHeader.Ehdr64.e_ehsize);
if (Verbose) printf(" e_phentsize = %d\n", ElfHeader.Ehdr64.e_phentsize);
Expand Down Expand Up @@ -2113,7 +2113,7 @@ int32 GetTblDefInfo(void)
SeekOffset = (uint32_t) (calculated_offset);
if (SeekOffset != calculated_offset)
{
printf("Error: SeekOffset may not be %ld\n", calculated_offset);
printf("Error: SeekOffset may not be %lu\n", calculated_offset);
Status = FAILED;
}
fseek(SrcFileDesc, SeekOffset, SEEK_SET);
Expand Down Expand Up @@ -2203,7 +2203,7 @@ int32 LocateAndReadUserObject(void)

if (Verbose)
{
printf("\ni = %d, NumSymbols = %ld\n", i, NumSymbols);
printf("\ni = %d, NumSymbols = %lu\n", i, NumSymbols);
if (i < NumSymbols)
{
printf("\nSymbolName = '%s', ObjectName = '%s'\n",SymbolNames[i], TblFileDef.ObjectName);
Expand Down Expand Up @@ -2248,7 +2248,7 @@ int32 LocateAndReadUserObject(void)
SeekOffset = (uint32_t) (calculated_offset);
if (SeekOffset != calculated_offset)
{
printf("Error: SeekOffset may not be %ld\n", calculated_offset);
printf("Error: SeekOffset may not be %lu\n", calculated_offset);
Status = FAILED;
}
fseek(SrcFileDesc, SeekOffset, SEEK_SET);
Expand Down