-
-
Save LemonBoy/031c98e75384c1fc28a2905826a51d1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
export fn init_fn() void { | |
_ = std.c.printf(c"Hello!\n"); | |
} | |
export fn another_init_fn() void { | |
_ = std.c.printf(c"Hello again!\n"); | |
} | |
export fn fini_fn() void { | |
_ = std.c.printf(c"Bye!\n"); | |
} | |
const Fn = extern fn () void; | |
export const init_array linksection(".init_array") = [_]Fn{ | |
init_fn, | |
another_init_fn, | |
}; | |
export const fini_array linksection(".fini_array") = [_]Fn{ | |
fini_fn, | |
}; | |
pub fn main() void { | |
std.debug.warn("hallo from main!\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment