That's not the case with many other standard libraries. Granted, only supporting static link for now does help.
-
-
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
How does the process locate the headers? What other reasons besides TLS?
1 reply 0 retweets 0 likes -
Replying to @sortiecat @oshepherd
Via auxv slot AT_PHDR. Dwarf unwinding/exception handling also needs program headers for .eh_frame.
2 replies 0 retweets 0 likes -
Replying to @RichFelker @oshepherd
Right auxv was my guess. Yet to look into .eh_frame. It's just like with TLS, already mapped, libc just needs to find it?
1 reply 0 retweets 0 likes
Yeah. Normal model is that libgcc_eh/libunwind calls dl_iterate_phdr (in libc) which finds the program headers for main prog & each lib.
-
-
Then once it has the program headers it can search for PT_GNU_EH_FRAME or whatever it's called.
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.