[mc1322x] "atoi" oversize

Mariano Alvira mar at devl.org
Fri Jul 2 11:37:02 EDT 2010


On Fri, Jul 02, 2010 at 11:18:27AM -0400, Mariano Alvira wrote:
> On Fri, Jul 02, 2010 at 04:01:39PM +0200, Daniel Berenguer wrote:
> 
> In this case its the call to setlocale by strtol --- but I'm having a
> hard time replacing it without a linker error...

looking at the .map, setlocale.o is linked because of 

uint8_t *_nl_category_name_idxs;

You then have to link with the following line instead of the one from
the Makefile:

arm-linux-ld -T ../mc1322x.lds -nostartfiles -static
-Map=printf_redbee-econotag.map -export-dynamic  -L
/home/malvira/mc1322x-oe/tmp/cross/armv4t/lib/gcc/arm-linux/4.3.2
-L ../lib -L ../src -L obj_redbee-econotag_board
obj_redbee-econotag_board/printf.o -o printf_redbee-econotag.elf
../src/start.o         ../src/src.a obj_redbee-econotag_board/board.a
../lib/libmc1322x.a --start-group obj_redbee-econotag_board/tests.o
-lgcc -lgcov -lgcc_eh -lc --end-group

This creates a normal sized elf and binary, but atoi does not work. If
_nl_category_name_idxs is set properly, however, they may be a chance
to get the glibc version working. 

A better approach might be newlib (either using a newlib toolchain or
lifting newlib's atoi).

-Mar.



More information about the mc1322x mailing list