diff --git a/Makefile b/Makefile deleted file mode 100644 index 611f61a..0000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -default: - @echo "This Makefile is obsolete. Please see the README.txt file and use the " - @echo "correct makefile in the for-build directory. The elf2cfetbl utility " - @echo "should be compiled and called automatically from the buid/ directory." - diff --git a/elf2cfetbl.c b/elf2cfetbl.c index 179b073..b230c8e 100644 --- a/elf2cfetbl.c +++ b/elf2cfetbl.c @@ -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 @@ -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: @@ -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 @@ -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); @@ -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); @@ -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); @@ -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); @@ -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); diff --git a/for_build/Makefile b/for_build/Makefile deleted file mode 100644 index cc29c72..0000000 --- a/for_build/Makefile +++ /dev/null @@ -1,53 +0,0 @@ - -## -## Setup the include paths for this tool -## -INCLUDE_PATH = \ --I$(OSAL_SRC)/inc \ --I$(CFE_CORE_SRC)/tbl \ --I$(CFE_TOOLS)/elf2cfetbl \ --I$(CFE_CORE_SRC)/inc \ --I$(CFE_PSP_SRC)/pc-linux/inc \ --I$(CFE_PSP_SRC)/inc \ --I$(CFS_MISSION_INC) \ --I$ ../inc - - -## -## Define the C compiler -## -COMPILER = gcc - -## -## These defines are different than the cross compiler settings since they are -## used to compile a host build tool. -## -## These settings are assuming that the tool is being run on an x86 processor -## with a linux (or linux-like) operating system -## -## They will need to be changed if the build host is a different processor, such as a Raspberry Pi, etc -## -TARGET_DEFS = -D__ix86__ -D_ix86_ -D_LINUX_OS_ -DHWARCH=x86 -Dx86 -Dlinux -DX86PC -DBUILD=$(BUILD) -D_REENTRANT -D _EMBED_ - -## -## Architecture / debug defines -## -ARCH_DEFS = -m32 -g - -## -## Endian Defines -## -ENDIAN_DEFS=-D_EL -DENDIAN=_EL -DSOFTWARE_LITTLE_BIT_ORDER - -# -# The compile rule. Again, it is not based on the cross compiler for the target, but -# the compiler for the build host. -# -default: elf2cfetbl - -elf2cfetbl: - $(COMPILER) $(TARGET_DEFS) $(ENDIAN_DEFS) $(INCLUDE_PATH) $(ARCH_DEFS) -o elf2cfetbl \ - $(CFE_TOOLS)/elf2cfetbl/elf2cfetbl.c - -clean: - rm -f elf2cfetbl