Re: [uCsimm] m68k-pic32, adding _cleanup to libc

From: Joaquin Garay (jtagaurj@bi.ehu.es)
Date: Mon Sep 03 2001 - 06:17:41 EDT


> Simply create a file, e.g. cleanup.c, that contains only one line:
> _cleanup(){}
>
> Compile this file, and use it as your last object during linking:
>
> m68k-pic-coff-gcc mod1.o .... modN.o cleanup.o ....
>
> Regards,
> Erwin
>

Umm, seems I didn't make it clear enough, so I'm going to explain
exactly what I'm doing setp by step:

        - First I need to create three libraries, so I compile the sources to
object and put them together:

        m68k-pic-coff-gcc -fPIC -O2 -c some_source_file.c
        m68k-pic-coff-ar cr libmy_library.a first_file.o second_file.o ...
        m68k-pic-coff-ranlib libmy_library.a

        - The I compile the last file and link it with the libraries and a file
containig only _cleanup(){} (cleanup.o):

        m68k-pic-coff-gcc -fPIC -O2 -c my_program.c
        m68k-pic-coff-gcc -fPIC -O2 -c cleanup.c
        m68k-pic-coff-gcc -O2 -fPIC -o my_program source_file.o cleanup.o
-lmy_library

        - And now I get the following errors:

/opt/uClinux/m68k-pic-coff/bin/gld: region a5world is full (snmpd
section .bss)
/opt/uClinux/lib/gcc-lib/m68k-pic-coff/2.7.2.3-pic-060999/libgcc.a(_exit.o):
In function `exit':
libgcc2.c(.text+0xc): relocation truncated to fit: DISP16 _cleanup
mv: cannot stat `snmpd': No such file or directory
Can't open snmpd.coff

Now, somebody knows what I'm doing wrong? AFAIK I'm doing everything
I've to do when I've to do it... or not?

                                                        jokin
This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:44 EST