mescc: Mes C Library: Fixes for x86_64 crt1.c
* lib/linux/x86_64-mes/crt1.c (_start): Write only 4 bytes to int variables __stdin, __stdout, __stderr.
This commit is contained in:
parent
27d771e6ab
commit
198d4a652d
|
@ -29,22 +29,22 @@ void
|
|||
_start ()
|
||||
{
|
||||
asm (
|
||||
"mov $0,%%rax\n\t"
|
||||
"mov %%rax,%0\n"
|
||||
"mov $0,%%eax\n\t"
|
||||
"mov %%eax,%0\n"
|
||||
: "=r" (__stdin)
|
||||
: //no inputs ""
|
||||
);
|
||||
|
||||
asm (
|
||||
"mov $1,%%rax\n\t"
|
||||
"mov %%rax,%0\n"
|
||||
"mov $1,%%eax\n\t"
|
||||
"mov %%eax,%0\n"
|
||||
: "=r" (__stdout)
|
||||
: //no inputs ""
|
||||
);
|
||||
|
||||
asm (
|
||||
"mov $2,%%rax\n\t"
|
||||
"mov %%rax,%0\n"
|
||||
"mov $2,%%eax\n\t"
|
||||
"mov %%eax,%0\n"
|
||||
: "=r" (__stderr)
|
||||
: //no inputs ""
|
||||
);
|
||||
|
|
|
@ -25,13 +25,13 @@ int
|
|||
_start ()
|
||||
{
|
||||
asm ("mov____$i8,%rax !0");
|
||||
asm ("mov____%rax,0x32 &__stdin");
|
||||
asm ("movl___%eax,0x32 &__stdin");
|
||||
|
||||
asm ("mov____$i8,%rax !1");
|
||||
asm ("mov____%rax,0x32 &__stdout");
|
||||
asm ("movl___%eax,0x32 &__stdout");
|
||||
|
||||
asm ("mov____$i8,%rax !2");
|
||||
asm ("mov____%rax,0x32 &__stderr");
|
||||
asm ("movl___%eax,0x32 &__stderr");
|
||||
|
||||
#if 0 //MES_CCAMD64
|
||||
asm ("add____$i32,%rbp %0x80"); // FIXME: corresponds to x86_64/as.scm function-preamble-fu
|
||||
|
|
Loading…
Reference in a new issue