Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 2017 02:47:36 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-toolchain@FreeBSD.org
Subject:   [Bug 223752] clang __attribute__((constructor)) gets wrong input parameters
Message-ID:  <bug-223752-29464-ozCBbLUV7R@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-223752-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-223752-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help

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

--- Comment #19 from Mark Millard <markmi@dsl-only.net> ---
(In reply to dstaesse from comment #18)

You are welcome.

My guess is that this is outside POSIX completely and
is just ABI material for what you are doing.

In fact, looking around I found an ARM document
indicating an empty parameter list for its
.init_array context:

 Each translation unit provides a fragment of the constructor vector in an ELF
section called .init_array of type SHT_INIT_ARRAY (=0xE) and section flags
SHF_ALLOC + SHF_WRITE.

 Each element of the vector contains the address of a function of type extern
ā€œCā€ void (* const)(void) that, when called, performs part or all of the global
object construction for the translation unit. Producers must treat .init_array
sections as if they were read-only.

( http://infocenter.arm.com/help/topic/com.arm.doc.ihi0041e/IHI0041E_cppabi.pdf
page 19 of 24.)

So, not portable across all ABIs that have .init_array .

-- 
You are receiving this mail because:
You are the assignee for the bug.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223752-29464-ozCBbLUV7R>