[PATCH] Reduce the statically linked startup code [BZ #23323]

Florian Weimer fweimer@redhat.com
Thu Feb 25 18:52:19 GMT 2021


* Mike Frysinger:

> On 18 Feb 2021 14:12, Florian Weimer via Libc-alpha wrote:
>> --- a/csu/libc-start.c
>> +++ b/csu/libc-start.c
>>  
>> +/* Note: This code is only part of the startup code proper for
>> +   statically linked binaries.  For dynamically linked binaries, it
>> +   resides in libc.so.  */
>
> i'm having a hard time reconciling this comment.  it makes it sound like
> the code in this file is only used in static binaries.  at which point,
> what is the reference to libc.so for, and why is SHARED check ?
>
> i'm guessing you're trying to clarify the linkage behavior for readers.
> maybe use that phrasing/framing instead ?

What about this?

/* Note: This file is part of the startup code in statically linked
   programs.  From the statically linked startup code, dynamically
   linked programs call __libc_start_main in libc.so, which is compiled
   from this file as well, but not part of the statically linked startup
   code due to this separation.  */

I hope this explains what is going on.

Thanks,
Florian



More information about the Libc-alpha mailing list