This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

newlib error when printf float on x86-64


Hello, I have compiled newlib for the target x86_64-pc-elf and I
created a libgloss.c with the system calls compatible with linux.
But when I try to printf float/double values, I got a segmentation fault:

#include <stdio.h>
int main()
{
      float b = 156;
      printf("ola %f\n", b);
      return 0;
}

gdb reports this:

(gdb) r
Starting program: /home/eduardo/Área de Trabalho/teste/a.out

Program received signal SIGSEGV, Segmentation fault.
0x000000000040089c in printf (fmt=0x409660 "ola %f\n") at
../../../../../newlib-1.18.0/newlib/libc/stdio/printf.c:45
45      {
(gdb) bt
#0  0x000000000040089c in printf (fmt=0x409660 "ola %f\n") at
../../../../../newlib-1.18.0/newlib/libc/stdio/printf.c:45
#1  0x00000000004001cf in main () at float.c:6

thanks in advance

Eduardo Henrique Molina da Cruz

-- 
Eduardo Henrique Molina da Cruz
Bacharelado em Ciência da Computação
Universidade Estadual de Maringá

"Ciência da computação tem tanto a ver com o computador como a
Astronomia com o telescópio, a Biologia com o microscópio, ou a
Química com os tubos de ensaio. A Ciência não estuda ferramentas, mas
o que fazemos e o que descobrimos com elas." (Edsger Dijkstra)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]