summaryrefslogtreecommitdiff
path: root/output/outlib.c
blob: e1b61b181e5c131f4c49b226a3cfd90bafb943c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
    }
}