From 99adb48d94c59cb2e5701ca39d7c40d4f63459b3 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 18 Oct 2025 18:12:19 +0200 Subject: #pragma once --- obj.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'obj.c') diff --git a/obj.c b/obj.c index 748e1e7..93a0a50 100644 --- a/obj.c +++ b/obj.c @@ -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; -- cgit v1.2.3