[TUHS] crt0 -- what's in that name?

Paul Winalski paul.winalski at gmail.com
Tue Jun 13 06:58:48 AEST 2023


On 6/12/23, Chris Pinnock via TUHS <tuhs at tuhs.org> wrote:
>
>> On 12 Jun 2023, at 21:22, Dan Cross <crossd at gmail.com> wrote:
>>
>> Hmm. The comment at the top of `crt0.s` from 2nd Edition says, "C
>> runtime startoff", which seems pretty clear. Whether that has changed
>> over time is, of course, another matter (like how GCC changed to "GNU
>> Compiler Collection").
>
> Possibly - in this file
> http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/README?rev=1.6&content-type=text/x-cvsweb-markup&only_with_tag=MAIN,
> the CSU and related files are referred to as the compiler runtime. But
> startoff is appropriate - because the file was usually included in the
> binary at the beginning to initialise stuff.

It may be that crt stood for "compiler run time" back when C was the
only compiler in town.  But once you get another language, such as
Fortran, that has its own, different runtime initialization
requirements, having the 'c' in crt0 mean "C" rather than "compiler"
because it's no longer common to all compiler run time libraries.

-Paul W.


More information about the TUHS mailing list