aboutsummaryrefslogtreecommitdiffhomepage
path: root/obj.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-06-18 09:05:15 +0200
committerlemon <lsof@mailbox.org>2023-06-18 09:05:15 +0200
commit04de327e9ac7c1502716336e9bbfecf544b31126 (patch)
tree52c1644c5b10c492037d8853b07155c8d334329b /obj.c
parent962ad175aee634274b408ead38b13e6bc90e2fe7 (diff)
ELF output static data
Diffstat (limited to 'obj.c')
-rw-r--r--obj.c5
1 files changed, 5 insertions, 0 deletions
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;
}