Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22248

Why do you need crt2.o in C++?

$
0
0

Programm Hello World (hello.s)

    .dataLC0:    .ascii "Hello, World!\0"    .text    .globl  _main_main:    pushl   %ebp    movl    %esp, %ebp    andl    $-16, %esp    subl    $16, %esp    movl    $LC0, (%esp)    call    _puts    xorl    %eax, %eax    leave    ret

1 compilation method

as.exe hello.sld -s a.out -LC:\gcc\lib -lmsvcrt -o hello.exe(2kb)

2 compilation method(standart)

as.exe hello.sgcc -s a.out -o hello.exe(12kb)

I found that the increase in the size of hello.exe is associated with the attachment of the crt2.o file. What specific function does it perform?


Viewing all articles
Browse latest Browse all 22248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>