summaryrefslogtreecommitdiff
path: root/output/outlib.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-06-27 22:07:33 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-06-27 22:07:33 -0700
commit31b707bef0af5fffe7c507089e1e281925b13aae (patch)
tree694e0784b6cf601eed73edcdde4ceb4dd2872255 /output/outlib.c
parent2b1f51f1cac1e6b7b75d226b2e01329365319d0d (diff)
downloadnasm-31b707bef0af5fffe7c507089e1e281925b13aae.tar.gz
Move backend-specific code to output/; break out null debug stuff
Move backend-specific code into the output/ directory, and make the null debugging backend a separate file (it certainly isn't needed for ndisasm...) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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 00000000..e1b61b18
--- /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;
+ }
+}