Just having an odd error case, like out of memory, or file descriptors, means things that almost always works sometimes might not.
-
-
Replying to @sortiecat
#Sortix libc has no error conditions between _start and main. If the program is loaded, it will reach main. I'm proud of that.1 reply 4 retweets 7 likes -
Replying to @sortiecat
That's not the case with many other standard libraries. Granted, only supporting static link for now does help.
1 reply 0 retweets 0 likes -
Replying to @sortiecat
On Linux, a static program has to open its own ELF executable to initialize thread local storage. On
#Sortix, the kernel does that.1 reply 0 retweets 0 likes -
Replying to @sortiecat
"has to open its' own ELF executable" hmm? Isn't the thread segment just loaded somewhere into memory to be copied by startup code?
1 reply 0 retweets 1 like -
Replying to @erincandescent @oshepherd
Hmm looks like you're right according to a quick strace. I am not sure where I got this idea then.
1 reply 0 retweets 0 likes -
Replying to @sortiecat @oshepherd
It has to process its own program headers to find the TLS image and copy it to main thread's TLS, but that doesn't involve file loading.
2 replies 0 retweets 2 likes -
Replying to @RichFelker @oshepherd
Aha - so the kernel loads the program headers for static programs? libc then iterates them and locates TLS?
2 replies 0 retweets 0 likes -
Replying to @sortiecat @oshepherd
The program headers are part of one of the PT_LOAD maps since they're needed at runtime for various reasons including TLS.
2 replies 0 retweets 1 like -
Replying to @RichFelker @oshepherd
Aha - did not know that. Feels a little dirty to me.
2 replies 0 retweets 0 likes
It's intentional - keeps as much logic as possible out of potentially-privileged loader code.
-
-
Replying to @RichFelker @oshepherd
It's not so bad in my case and it makes my libc initialization much simpler and static executables smaller.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.