summaryrefslogtreecommitdiff
path: root/output/outlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'output/outlib.c')
-rw-r--r--output/outlib.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/output/outlib.c b/output/outlib.c
new file mode 100644
index 0000000..e1b61b1
--- /dev/null
+++ b/output/outlib.c
@@ -0,0 +1,23 @@
+/*
+ * libout.c
+ *
+ * Common routines for the output backends.
+ */
+
+#include "compiler.h"
+#include "nasm.h"
+#include "output/outlib.h"
+
+uint64_t realsize(enum out_type type, uint64_t size)
+{
+ switch (type) {
+ case OUT_REL2ADR:
+ return 2;
+ case OUT_REL4ADR:
+ return 4;
+ case OUT_REL8ADR:
+ return 8;
+ default:
+ return size;
+ }
+}