aboutsummaryrefslogtreecommitdiffhomepage
path: root/obj.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-18 18:12:19 +0200
committerlemon <lsof@mailbox.org>2025-10-18 18:12:19 +0200
commit99adb48d94c59cb2e5701ca39d7c40d4f63459b3 (patch)
treebe3c432db54dd7f4e1ceab70848543bba1a4ead8 /obj.c
parentffca6b54a9654005a121c3557bb8b245ae65ce55 (diff)
#pragma once
Diffstat (limited to 'obj.c')
-rw-r--r--obj.c11
1 files changed, 6 insertions, 5 deletions
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;