https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223752

--- Comment #21 from David Chisnall <thera...@freebsd.org> ---
It's also worth noting that functions declared with this attribute can have
some complex interaction with threading.  If a process spawns a thread which
calls `dlopen` then all of the library's constructors will be called in that
thread.  At this point, it's not clear whether the run-time linker will even
have access to the arguments that you want.  It's also not clear what `envp`
should be (the current environment, or the environment from process creation
time?)

I believe glibc provides an `__arguments` variable, along the same lines as
`__environ`, which allows the process to get access to the arguments from
arbitrary points in the code.  Implementing something like this would probably
be the best solution for this use case.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"

Reply via email to