diff options
author | Freya Murphy <freya@freyacat.org> | 2024-09-22 16:02:42 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-09-22 16:02:42 -0400 |
commit | 85471efb4c740bb775c9ebdb10f775620c979598 (patch) | |
tree | c4afa5cf8108df4192e73488c4da271ed166217c /masm/asm.c | |
parent | update make clear (diff) | |
download | mips-85471efb4c740bb775c9ebdb10f775620c979598.tar.gz mips-85471efb4c740bb775c9ebdb10f775620c979598.tar.bz2 mips-85471efb4c740bb775c9ebdb10f775620c979598.zip |
mld done
Diffstat (limited to 'masm/asm.c')
-rw-r--r-- | masm/asm.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -315,7 +315,7 @@ static int assemble_phdr(struct assembler *assembler, Elf32_Phdr **res, Elf32_Phdr *phdr = malloc(sizeof(Elf32_Phdr) * assembler->sectab.len); if (phdr == NULL) { - ERROR("cannot alloc"); + PERROR("cannot alloc"); return M_ERROR;; } @@ -354,6 +354,11 @@ static int assemble_shdr(struct assembler *assembler, Elf32_Shdr **res, Elf32_Shdr *shdr = malloc(sizeof(Elf32_Shdr) * max_entries); + if (shdr == NULL) { + PERROR("cannot alloc"); + return M_ERROR; + } + size_t str_off; uint32_t count = 0; @@ -593,7 +598,7 @@ static int write_file(struct assembler *assembler, Elf32_Ehdr *ehdr, if (out == NULL) { - ERROR("cannot write '%s'", path); + PERROR("cannot write '%s'", path); return M_ERROR; } |