[Bug 223752] clang __attribute__((constructor)) gets wrong input parameters

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Nov 19 23:47:50 UTC 2017


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

--- Comment #6 from Mark Millard <markmi at dsl-only.net> ---
(In reply to dstaesse from comment #4)

Also: in looking around I find that every
official webpage/document about this that
shows examples shows functions with no
arguments. (But none that I found has any
explicit words about the argument list
requirements. None say that the arguments
are the same as for any standard variation
for how main can be declared.)

For a stack architecture, there would be stack
pushes set up before the calls and pops set
up after the calls. In architectures with
some degree of register-based argument passing
it is harder to see what has a
garbage-in/garbage-out/accidental status vs.
what is deliberate.

It looks to me like the existing documentation
could stand an update about parameters and
arguments.

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


More information about the freebsd-toolchain mailing list