From 5bffc17c42bb6eacd0cc09a61954e98ccf912fa4 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 1 Dec 2022 16:32:09 +0100 Subject: codegen: make LinkerLoad a common struct shared by backends --- src/codegen.zig | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/codegen.zig') diff --git a/src/codegen.zig b/src/codegen.zig index 5a28ce1860..d6b2ed7d93 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -68,6 +68,19 @@ pub const DebugInfoOutput = union(enum) { none, }; +/// Helper struct to denote that the value is in memory but requires a linker relocation fixup: +/// * got - the value is referenced indirectly via GOT entry index (the linker emits a got-type reloc) +/// * direct - the value is referenced directly via symbol index index (the linker emits a displacement reloc) +/// * import - the value is referenced indirectly via import entry index (the linker emits an import-type reloc) +pub const LinkerLoad = struct { + type: enum { + got, + direct, + import, + }, + sym_index: u32, +}; + pub fn generateFunction( bin_file: *link.File, src_loc: Module.SrcLoc, -- cgit v1.2.3