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

From: Joaquin Garay (
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

        - And now I get the following errors:

/opt/uClinux/m68k-pic-coff/bin/gld: region a5world is full (snmpd
section .bss)
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?

This message resent by the list server

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