Still need (desperately!!!) help with initializing code

Leon Pollak leonp at plris.com
Wed Nov 26 14:51:38 UTC 2003


Gregory,
	I have crtbegin.o   crtbeginT.o  ecrti.o  ncrtn.o crtbeginS.o  ecrtn.o 
ncrti.o files in gcc/860 directory.

	Function _ini resides only in ecrt.o and ncrti.o and contains:

ecrti.o:     file format elf32-powerpc
Disassembly of section .text:
Disassembly of section .init:
00000000 <__init>:
   0:   94 21 ff f0     stwu    r1,-16(r1)
   4:   7c 08 02 a6     mflr    r0
   8:   90 01 00 14     stw     r0,20(r1)
Disassembly of section .fini:
00000000 <__fini>:
   0:   94 21 ff f0     stwu    r1,-16(r1)
   4:   7c 08 02 a6     mflr    r0
   8:   90 01 00 14     stw     r0,20(r1)


ncrti.o:     file format elf32-powerpc
Disassembly of section .text:
Disassembly of section .init:
00000000 <_init>:
   0:   94 21 ff f0     stwu    r1,-16(r1)
   4:   7c 08 02 a6     mflr    r0
   8:   93 e1 00 0c     stw     r31,12(r1)
   c:   90 01 00 10     stw     r0,16(r1)
  10:   4b ff ff fd     bl      c <_init+0xc>
  14:   7f e8 02 a6     mflr    r31
Disassembly of section .fini:
00000000 <_fini>:
   0:   94 21 ff f0     stwu    r1,-16(r1)
   4:   7c 08 02 a6     mflr    r0
   8:   93 e1 00 0c     stw     r31,12(r1)
   c:   90 01 00 10     stw     r0,16(r1)
  10:   4b ff ff fd     bl      c <_fini+0xc>
  14:   7f e8 02 a6     mflr    r31

	Can you point out which one of them is suitable? And what about all these 
ctr*.o? What are they for?
	You write that they (who?) must be positioned in the right order for linker, 
but what order is right? May be I can read about this instead of bombarding 
mail list with such questions?
------------------------------------------------------------------------------------------------------------
 About copying rom->ram. I thought that only .data section ,ust be copied, but 
you wrote:
	From the standpoint of copying from rom to ram, the init,fini code is
	usually copied right along with .text.
Does this mean that also sections .init and .fini must be copied?



Thanks you very much for your help.

-- 
Leon Pollak
leonp at plris dot com




More information about the users mailing list