From 04de327e9ac7c1502716336e9bbfecf544b31126 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 18 Jun 2023 09:05:15 +0200 Subject: ELF output static data --- obj.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'obj.c') diff --git a/obj.c b/obj.c index 68d183f..f2b0623 100644 --- a/obj.c +++ b/obj.c @@ -8,6 +8,7 @@ void elfinit(void); void elfaddsym(const char *, int info, enum section, uvlong value, uvlong size); void elfreloc(const char *sym, enum relockind, enum section, uint off, vlong addend); +void elfputdat(const struct irdat *); void elffini(struct wbuf *); struct objfile objout; @@ -54,6 +55,10 @@ objfini(void) 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)); + for (int i = 0; i < dattab.n; ++i) { + elfputdat(&dattab.p[i]); + } + switch (mctarg->objkind) { case OBJELF: elffini(&out); break; } -- cgit v1.2.3