This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos 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]

Can´t bind printf - Help!


Hi everybody.

I am strugling with ld since i always get the message "undefined reference to `printf'" when trying to build my ecos application.

The platform is the Gameboy Advance (ARM7) and i am compiling with an ecos repository snapshot from 01-may-2005.

I used objdump and could see 'printf' was included in libtarget.a (file printf.cxx) as shown below:


language_c_libc_stdio_printf.o: file format elf32-little


SYMBOL TABLE:
00000000 l    df *ABS* 00000000 printf.cxx
00000000 l    d  .text 00000000
00000000 l    d  .data 00000000
00000000 l    d  .bss 00000000
00000000 l    d  .debug_abbrev 00000000
00000000 l    d  .debug_info 00000000
00000000 l    d  .debug_line 00000000
00000000 l    d  .text.printf 00000000
00000000 l    d  .debug_frame 00000000
00000000 l    d  .debug_pubnames 00000000
00000000 l    d  .debug_aranges 00000000
00000000 l    d  .debug_str 00000000
00000000 l    d  .comment 00000000
00000000 g       .text.printf 00000020 printf
00000000         *UND* 00000000 vfnprintf
00000000         *UND* 00000000 stdout


By looking into the map file created by ld when trying to build the application, i could see for example that 'vfnprintf' was bound into the executable but not printf:



.text.vfnprintf
0x08020604 0x9d4 C:\Desen\C\ecos\ecos-gbax-19-09-2005-net\ecos-gbax-19-09-2005-net_install\lib/libtarget.a(language_c_libc_stdio_vfnprintf.o)
0x08020604 vfnprintf



Is it related to thumb/ARM mode compatibilities between libtarget.a and my application? I used -mthumb and -thumb-interwork to compile both. I ask this because at the end of the map file i found the following section:


.glue_7t 0x0802a35c 0x30 C:\cygwin\opt\ecos\gnutools\arm-elf\lib\gcc-lib\arm-elf\3.2.1\thumb\interwork/libgcc.a(_clz.o)
0x0802a374 __sscanf_from_thumb
0x0802a364 __isspace_from_thumb
0x0802a35c __printf_from_thumb
0x0802a37c __floor_from_thumb
0x0802a388 __fprintf_change_to_arm
0x0802a380 __floor_change_to_arm
0x0802a370 __tolower_change_to_arm
0x0802a360 __printf_change_to_arm
0x0802a368 __isspace_change_to_arm
0x0802a378 __sscanf_change_to_arm
0x0802a384 __fprintf_from_thumb
0x0802a36c __tolower_from_thumb
0x0802a38c _etext = .
0x0802a38c PROVIDE (__etext, .)



and i´ve got also the same problem for 'isspace', 'tolower', 'sscanf', 'floor' and 'fprintf' which coincidently are the functions shown on the section above.


The template used to build ecos was 'net' and i think it includes everything i need to use 'printf'.

Regards.

Ramiro C. Carvalho.
ramiro.carvalho@uol.com.br


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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