Microsoft C specific question about __acrtused

Risto Lankinen risto at tuura.UUCP
Thu Oct 4 18:48:39 AEST 1990


gday at digigw.digital.co.jp (Gordon Day) writes:

>I have been mixing assembly language and C routines successfully, but when
>setting up the runtime environment for C subroutines I have to define the
>symbol __acrtused in the DGROUP group to keep the linker happy.  What is 
>significance of this value? What should it be set to, or does it really 
>matter? (My belief is that it is only of significance if the crt0.obj startup
>are being used, but in that case, why is it being defined public?)

Hi!

Suppose you made a C program which makes no calls to the C libraries.  When
you link such a program, the linker would not need to search the C run-time
library file, and the program would lack the start address (defined in the
CRT0.ASM of the C library) among other things.  However, the presence of
the C run-time initialization code is in many cases essential, and this is
why the compiler makes an explicit reference to __acrtused (compile with
'-Fa' to see yourself), to ensure that the C run-time start-up code will
be linked to the application's .EXE .  The __acrtused itself is a dummie,
and it has been assigned an absolute value of 0x9876 (a 'rare' value as
an address to anything in order not to confuse SYMDEB.EXE ).  The assembly
code needs to refer to the __acrtused only if it in turn refers to C run-
time library functions either explicitly or implicitly via a (self-made)
C function.

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto at yj.data.nokia.fi     ***************************************



More information about the Comp.lang.c mailing list