<__ctors_end>???

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, I'm checking out my .lss file, and I'm wondering what the <__ctors_end> section does....
I couldn't find any forum posts, or anything in the avr-libc documentation on it. Basically, I've got a huge mass of code in this section that never gets called or executed from the main program, and its almost all fmulsu r19, r20 instructions:

00000054 <__ctors_end>:
  54:	bc 03       	fmulsu	r19, r20
  56:	94 03       	fmuls	r17, r20
  58:	96 03       	fmuls	r17, r22
  5a:	98 03       	fmulsu	r17, r16
  5c:	9a 03       	fmulsu	r17, r18
  5e:	9c 03       	fmulsu	r17, r20
  60:	9e 03       	fmulsu	r17, r22
  62:	a0 03       	fmuls	r18, r16
  64:	a2 03       	fmuls	r18, r18
  66:	a4 03       	fmuls	r18, r20
  68:	bc 03       	fmulsu	r19, r20
  6a:	bc 03       	fmulsu	r19, r20
  6c:	bc 03       	fmulsu	r19, r20
  6e:	bc 03       	fmulsu	r19, r20
  70:	bc 03       	fmulsu	r19, r20
  72:	bc 03       	fmulsu	r19, r20
 

It goes on like this to address 00fe. I've seen this section with different code before that actually gets used in other programs, but not this current one. Does anyone know what it does?

Thanks,
JeremyB.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Others will jump in and correct this if I'm wrong, but I think that the <__ctors_end> simply marks the end of the interrupt vectors (which starts with <__vectors> at location 0). I have no idea what the fmuls(u) instructions are - I've never seen this before. In the .lss files I've looked at, this is always the start of the program and usually contains the variable initialization.

Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

If I remember correctly, ctors and dtors are the sections for C++ constructors and destructors respectively, contained between labeled pairs ctors_start/ctors_end, and dtors_start/dtors_end. In a C/asm only program that sections should be empty. The junk code after is probably data (disassembled as code) for static/global variables initialization. 0x03bc, 0x0394, 0x0396, ... sounds like an int array.

Regards,

Carlos.