I'm trying to run programs compiled by my own toolchain including newlib and ran into a weird issue.
This is my test program:
Code: Select all
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
write(STDOUT_FILENO, "test1\n", 6);
// FILE *out = fopen("stdout", "w");
fputs("test2\n", stdout);
// FILE *out = fopen("stdout", "w");
return 0;
}
Any hints on what could be wrong? I know I'm not zeroing bss on program loading, which could be a start but I don't see why that would matter in this case.