[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    [uClinux-dev] ccmalloc on Coldfire
From:       Igor Plyatov <plyatov () gmail ! com>
Date:       2009-05-27 5:20:58
Message-ID: 1243401658.22800.7.camel () homepc ! home
[Download RAW message or body]

Dear all,

I use uClinux on m68knommu plaftorm for embedded device and have a
problem with memory allocation/deallocation in C++ application.

I try to use ccmalloc library, but encounter some problems:

1. lack of sbrk function in libraries.

ucfront-gcc m68k-uclinux-gcc -m5307 -DCONFIG_COLDFIRE -Wl,-elf2flt
-Wl,-move-rodata -msep-data -Wl,-elf2flt -Wl,-move-rodata -msep-data -o
telnetd /home/plyatov/development/uClinux-20090302/lib/libccmalloc/lib/ccmalloc-gcc.o \
/home/plyatov/development/uClinux-20090302/lib/libccmalloc/lib/libccmalloc.a \
telnetd.o state.o termstat.o slc.o sys_term.o utility.o global.o authenc.o logwtmp.o \
                logout.o -lutil -lutil 
telnetd.elf2flt: In function `MY_malloc':
src/myalloc.c:115: undefined reference to `sbrk'
collect2: ld returned 1 exit status
make[3]: *** [telnetd] Error 1

I resolve this problem by such ccmalloc's Makefile change:

-OBJ=obj/callchain.o obj/hash.o obj/wrapper.o
+OBJ=obj/callchain.o obj/hash.o obj/wrapper.o obj/sbrk.o

+obj/sbrk.o: src/config.h ../uClibc/libc/sysdeps/linux/common/sbrk.c
+       $(CC) $(CFLAGS) -c -o$@ \
+       ../uClibc/libc/sysdeps/linux/common/sbrk.c

is this a right solution?


2. applications linked with libccmalloc, write only part of information
to logfile. There is no ccmalloc report produced :-(
   For example, telnetd gives such output:
.----------------------------------------------------------------------.
> ================ ccmalloc-0.3.9 (C) 1997-2001 Armin Biere ============|
+----------------------------------------------------------------------+
> executable       = telnetd                                           |
> startup file     = .ccmalloc                                         |
> log file         = /var/disk1/telnet.log                             |
> start time       = Tue Nov 30 00:01:55 1999                          |
> operating system = uClinux 2.4.20-uc0 m68knommu on GS100014          |
+----------------------------------------------------------------------+
> only-count        = 0            keep-deallocated-data = 0           |
> check-interval    = 0            check-free-space      = 0           |
> check-start       = 0            file-info             = 0           |
> chain-length      = 0            additional-line       = 1           |
> check-underwrites = 0            print-addresses       = 0           |
> check-overwrites  = 0            print-on-one-line     = 0           |
> sort-by-wasted    = 1            sort-by-size          = 1           |
> # only-log-chain  = 0            continue              = 0           |
> # dont-log-chain  = 0            statistics            = 0           |
> debug             = 0            library-chains        = 0           |
> load-dynlibs      = 0            align-8-byte          = 0           |
> only-wasting-alloc= 1                                                |
`----------------------------------------------------------------------'
And nothing more.

.ccmalloc content:
   file telnetd
   log /var/disk1/telnetd.log
   file-info 0
   set only-wasting-alloc 0

What can be wrong?

Thanks in advance and best regards!
--
Igor Plyatov

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic