2016-11-27 21:05:15 +00:00
|
|
|
#ifndef B_H
|
|
|
|
#define B_H
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#if EM_PSIZE == 2
|
|
|
|
#define SHIFT 1
|
|
|
|
#elif EM_PSIZE == 4
|
|
|
|
#define SHIFT 2
|
|
|
|
#elif EM_PSIZE == 8
|
|
|
|
#define SHIFT 3
|
|
|
|
#else
|
|
|
|
#error Unsupported EM_PSIZE
|
|
|
|
#endif
|
|
|
|
|
2019-06-17 20:27:13 +00:00
|
|
|
#define MASK ((1<<SHIFT)-1)
|
|
|
|
|
2016-12-29 17:10:21 +00:00
|
|
|
extern FILE* input_unit;
|
2016-11-27 21:05:15 +00:00
|
|
|
extern FILE* output_unit;
|
|
|
|
|
2016-12-29 17:10:21 +00:00
|
|
|
#define END 4
|
|
|
|
|
2016-12-31 17:39:51 +00:00
|
|
|
extern uintptr_t* bmodule_main[];
|
|
|
|
|
|
|
|
extern void patch_addresses(uintptr_t** p);
|
|
|
|
|
|
|
|
extern void binit(void);
|
|
|
|
|
2016-11-27 21:05:15 +00:00
|
|
|
#endif
|