diff options
| author | 2025-10-18 18:12:19 +0200 | |
|---|---|---|
| committer | 2025-10-18 18:12:19 +0200 | |
| commit | 99adb48d94c59cb2e5701ca39d7c40d4f63459b3 (patch) | |
| tree | be3c432db54dd7f4e1ceab70848543bba1a4ead8 /obj.c | |
| parent | ffca6b54a9654005a121c3557bb8b245ae65ce55 (diff) | |
#pragma once
Diffstat (limited to 'obj.c')
| -rw-r--r-- | obj.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -16,10 +16,11 @@ struct objfile objout; enum { NTEXT = 4<<20 /* 4MiB */ }; void -objini(const char *file) +objini(const char *infile, const char *outfile) { - assert(!objout.file); - objout.file = file; + assert(!objout.outfile); + objout.infile = infile; + objout.outfile = outfile; objout.code = objout.textbegin = mapzeros(NTEXT); objout.textend = objout.textbegin + NTEXT; @@ -90,8 +91,8 @@ void objfini(void) { static char buf[1<<12]; - struct wbuf out = FDBUF(buf, sizeof buf, open(objout.file, O_WRONLY | O_CREAT | O_TRUNC, 0666)); - if (out.fd < 0) fatal(NULL, "could not open %'s for writing: %s", objout.file, strerror(errno)); + struct wbuf out = FDBUF(buf, sizeof buf, open(objout.outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666)); + if (out.fd < 0) fatal(NULL, "could not open %'s for writing: %s", objout.outfile, strerror(errno)); switch (mctarg->objkind) { case OBJELF: elffini(&out); break; |