RustForge

rust-kernel

Rustbelt: a hobby x86_64 kernel written in Rust

rust-kernel / user / dynhello.c
405 bytes ยท raw
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
 * dynhello.c -- stage 19: a *dynamically linked* program (plain
 * `musl-gcc`, no -static). Its ELF file has a PT_INTERP header naming
 * the dynamic loader /lib/ld-musl-x86_64.so.1, which Rustbelt doesn't
 * have, so execve must fail with ENOEXEC ("Exec format error").
 */
#include <stdio.h>

int main(void)
{
	puts("hello from a dynamic program (you shouldn't see this on Rustbelt)");
	return 0;
}