From 96d9708dcf20c7537773bbc67f171b68b00e36d3 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 23 Sep 2020 15:16:07 -0400 Subject: split ut_list, ut_LinkList, and ut_BinaryFileFormat --- tools/patch_strtab/patch_strtab.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'tools/patch_strtab') diff --git a/tools/patch_strtab/patch_strtab.c b/tools/patch_strtab/patch_strtab.c index bbdd4ce..5327dc7 100644 --- a/tools/patch_strtab/patch_strtab.c +++ b/tools/patch_strtab/patch_strtab.c @@ -168,17 +168,6 @@ void Padding(FILE *fp, u32 padBytes) } } -// Write bufSize bytes from the buffer referenced by bufPtr to fp. -void Write(FILE *fp, const void *bufPtr, size_t bufSize) -{ - if (bufSize) { - if (fwrite(bufPtr, bufSize, 1, fp) != 1) { - fprintf(stderr, "ERROR: ins. disk space\n"); - exit(7); - } - } -} - // Swap the endianness of every field of ehdr and return ehdr Elf32_Ehdr *SwapEhdr(Elf32_Ehdr *ehdr) { @@ -274,15 +263,9 @@ char *LoadFile(char *path) } // Load the ELF file located by path into a newly malloc'd -// ElfStruct, then return the pointer to this ElfStruct. - -// Return NULL if an error occurs during malloc, file load, -// or if path does not locate an ELF file. - -// The ELF header, section header, symbols, and relas will all have their endianness -// swapped correctly. - -// Record pointers to the .symtab, .strtab, +// ElfStruct, then return the pointer to this ElfStruct. +// The ELF header, section headers, and symbols will all have their endianness +// swapped. Record pointers to the .symtab, .strtab, // and .shstrtab section headers in the ElfStruct if they exist ElfStruct *LoadElfFile(char *path) { -- cgit v1.2.3