diff options
author | Max <mparisi@stevens.edu> | 2020-09-23 15:16:07 -0400 |
---|---|---|
committer | Max <mparisi@stevens.edu> | 2020-09-23 15:16:07 -0400 |
commit | 96d9708dcf20c7537773bbc67f171b68b00e36d3 (patch) | |
tree | a2868f8f991fde1738ba7f64d907b221d6d5460f /tools/patch_strtab/patch_strtab.c | |
parent | 4e91f4772fb5e5d9ea80694e5aa7c27be4315a00 (diff) |
split ut_list, ut_LinkList, and ut_BinaryFileFormat
Diffstat (limited to 'tools/patch_strtab/patch_strtab.c')
-rw-r--r-- | tools/patch_strtab/patch_strtab.c | 23 |
1 files changed, 3 insertions, 20 deletions
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)
{
|