Skip to content

Commit 565339a

Browse files
committed
Add libc stubs
1 parent 3c3332f commit 565339a

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/libc_stub.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
void _init(void) {}
2-
void _fini(void) {}
3-
int __errno;
1+
__attribute__((used)) void _init(void) {}
2+
3+
__attribute__((used)) void _fini(void) {}
4+
5+
__attribute__((used)) void _exit(int x)
6+
{
7+
while (1)
8+
;
9+
}
10+
11+
__attribute__((used)) int _kill(int x) { return -1; }
12+
13+
__attribute__((used)) int _getpid() { return -1; }
14+
15+
__attribute__((used)) int *__errno()
16+
{
17+
static int errno = 0;
18+
return &errno;
19+
}
20+
421
void *__dso_handle = (void *)&__dso_handle;

0 commit comments

Comments
 (0)