These two functions initialize and delete global static data structures. The 
references to these symbols are generated in each gcc file and they are, imo, 
necessary in order to run C code because gcc assumes that the variables are 
initialized on program start.
The functions are defined in avr-libc's crt function and in libgcc (part of the 
compiler itself.).

If you want to write your own initialization routines: Go ahead and define a 
dummy assembler file

   .text
   .global __do_clear_bss   
   .global __do_copy_data
__do_copy_data
__do_clear_bss

And ld will no longer use the code from the libraries. But better be careful. 

Bjoern.

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von maha
Gesendet: Montag, 27. März 2006 09:00
An: [email protected]
Betreff: [avr-gcc-list] AVR-GCC--linker problems


Hello~
    I have a little questions about avr-gcc...
    What's the functions about "__do_clear_bss" and "__do_copy_data"? Do I
have 
to use them? Do I have other ways can replce them?( disappear them in my
test.o )
    Because I have to link and relocate symbols by myself. But, I don't know
how to link symbols that references to libraries.
    Can I pass test.o back to AVR-GCC and handles libraries linking after
done my work?( complete relocatable symbols' linking )
    And, where can I find more informations about this question?
    ./nm test.o     ( compiled but no linking )
00000000 a *ABS*
0000003e a __SP_H__
0000003d a __SP_L__
0000003f  a __SREG__
               U __do_clear_bss        <--\
               U __do_copy_data      <---- How to take them away and has no
effect  
00000000 a __tmp_reg__                  function about test.o
00000001 a __zero_reg__                                        
00000008 T cleanup_module                                         or
00000000 T init_module
               U ker_led                   <--Can I pass this test.o back to
avr-gcc to handles  
                                                   __do_clear_bss and
__do_copy_data after linking
                                                   ker_led by myself ?

  Help me please, Thanks a lot~

  Wang~

--
View this message in context: 
http://www.nabble.com/AVR-GCC--linker-problems-t1347495.html#a3604813
Sent from the AVR - gcc forum at Nabble.com.



_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list



_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to