mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] DT_PREINIT_ARRAY support
@ 2024-01-21 23:33 Fangrui Song
  2024-02-26  1:25 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Fangrui Song @ 2024-01-21 23:33 UTC (permalink / raw)
  To: musl

There is a DT_PREINIT_ARRAY patch that falls through the cracks:
 https://www.openwall.com/lists/musl/2016/05/17/2
I wonder whether it can be visited again.

I ported sanitizers to upstream compiler-rt. I have not had time to
track the latest status for musl, but I know that quite a few
sanitizers will benefit from musl supporting the feature and see
another recent issue about tsan
(https://github.com/llvm/llvm-project/issues/78452).

---

Some notes about DT_PREINIT_ARRAY

The linker defines DT_PREINIT_ARRAY and DT_PREINIT_ARRAYSZ according
to the address and size of .preinit_array. The linker also defines
__preinit_array_start and __preinit_array_end if referenced.

The generic ABI says:

> DT_PREINIT_ARRAY: This element holds the address of the array of pointers to pre-initialization functions, discussed in ``Initialization and Termination Functions'' below. The DT_PREINIT_ARRAY table is processed only in an executable file; it is ignored if contained in a shared object.

DT_PREINIT_ARRAY only applies to the executable. This feature gives
the executable a way to run initialization functions before shared
object dependencies.

There is no .postfini_array.

Most ld.so implementations support DT_PREINIT_ARRAY.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-27  0:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-21 23:33 [musl] DT_PREINIT_ARRAY support Fangrui Song
2024-02-26  1:25 ` Rich Felker
2024-02-26 22:31   ` Fangrui Song
2024-02-27  0:57     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).