From dea8fd171acb54b6d9685422d5e391fb55074008 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 19 Oct 2025 08:09:09 +0200 Subject: Organize source files into directories --- obj/obj.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 obj/obj.h (limited to 'obj/obj.h') diff --git a/obj/obj.h b/obj/obj.h new file mode 100644 index 0000000..235ab4d --- /dev/null +++ b/obj/obj.h @@ -0,0 +1,30 @@ +#include "../common.h" + +extern struct objfile { + const char *infile, *outfile; + uchar *textbegin, *textend; + uchar *code; + uchar dataalign, rodataalign, bssalign; + uint nbss; + vec_of(uchar) data, rodata; +} objout; + +enum relockind { + REL_ABS64, + REL_ABS32, + REL_ABS32S, + REL_PCREL32, + REL_PLT32, + REL_GOTPCRELX, + REL_GOTPCRELX_REX, + NRELOCKIND, +}; +enum section { Snone, Stext, Srodata, Sdata, Sbss }; + +void objini(const char *infile, const char *outfile); +void objdeffunc(const char *nam, bool globl, uint off, uint siz); +uint objnewdat(const char *name, enum section, bool globl, uint siz, uint align); +void objreloc(const char *sym, enum relockind, enum section, uint off, vlong addend); +void objfini(void); + +/* vim:set ts=3 sw=3 expandtab: */ -- cgit v1.2.3