Recent

Author Topic: [SOLVED] strange INITFINAL generation  (Read 1428 times)

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
[SOLVED] strange INITFINAL generation
« on: July 17, 2024, 12:45:30 am »
Finaly, I found it!

if I have no initialization in system.pp
he compiles me:
Code: ASM  [Select][+][-]
  1. .section .data.n_INITFINAL
  2.         .balign 4
  3. .globl  INITFINAL
  4. INITFINAL:
  5.         .long   1,0,0
  6.         .long   FINALIZE$_$OBJPAS
  7.  





If i have in system.pp:
Code: Pascal  [Select][+][-]
  1. ....
  2. begin
  3.   { Reset IO Error }
  4.   InOutRes:=0;
  5. end.
  6.  


he compiles me:
Code: ASM  [Select][+][-]
  1. .section .data.n_INITFINAL
  2.         .balign 4
  3. .globl  INITFINAL
  4. INITFINAL:
  5.         .long   2,0
  6.         .long   INIT$_$SYSTEM
  7.         .long   0,0
  8.         .long   FINALIZE$_$OBJPAS
  9.  


btw. I had another Read After Write Issue, I corrected it, now random() works as expected
« Last Edit: July 17, 2024, 09:43:07 am by Key-Real »

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: strange INITFINAL generation
« Reply #1 on: July 17, 2024, 09:42:51 am »
ups,

perhaps it was to late yesterday. This was not the issue. Sorry for spam.

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: [SOLVED] strange INITFINAL generation
« Reply #2 on: July 17, 2024, 07:35:29 pm »
!!!!!   
never do something in the system unit at initialization!
(between the final begin and end. )

PascalDragon

  • Hero Member
  • *****
  • Posts: 5764
  • Compiler Developer
Re: [SOLVED] strange INITFINAL generation
« Reply #3 on: July 18, 2024, 09:37:17 pm »
!!!!!   
never do something in the system unit at initialization!
(between the final begin and end. )

That is wrong. The whole System unit is supposed to be initialized there (parameter parsing, I/O, heap, etc.). Just look at what the initialization-section (which is equivalent to beginend in units) does in other targets.

 

TinyPortal © 2005-2018