Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 2017 00:57:32 +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-bYOpjEQW9w@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=3D223752

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

(In reply to dstaesse from comment #8)

I took a quick grep for -r325700 (head):

# grep -r __init_array_start /usr/src/* | more
/usr/src/contrib/llvm/tools/lld/ELF/Writer.cpp:  Define("__init_array_start=
",
"__init_array_end", Out::InitArray);
/usr/src/contrib/binutils/ld/scripttempl/elf.sc:=20=20=20=20
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN
(${USER_LABEL_PREFIX}__init_array_start =3D .);}}
/usr/src/contrib/binutils/ld/ChangeLog-2006:    (__preinit_array_start,
__preinit_array_end, __init_array_start,
/usr/src/lib/csu/common/ignore_init.c:extern void (*__init_array_start[])(i=
nt,
char **, char **) __hidden;
/usr/src/lib/csu/common/ignore_init.c:  array_size =3D __init_array_end -
__init_array_start;
/usr/src/lib/csu/common/ignore_init.c:          fn =3D __init_array_start[n=
];
/usr/src/sys/conf/ldscript.amd64:     PROVIDE_HIDDEN (__init_array_start =
=3D .);
/usr/src/sys/conf/ldscript.i386:     PROVIDE_HIDDEN (__init_array_start =3D=
 .);
/usr/src/sys/contrib/octeon-sdk/cvmx-shared-linux-o32.ld:  PROVIDE
(__init_array_start =3D .);
/usr/src/sys/contrib/octeon-sdk/cvmx-shared-linux.ld:     PROVIDE_HIDDEN
(__init_array_start =3D .);
/usr/src/sys/contrib/octeon-sdk/cvmx-shared-linux-n32.ld:     PROVIDE_HIDDEN
(__init_array_start =3D .);

Note the ldscript.* are limited to amd64 and i386 mentioning
__init_array_start explicitly.  The whole block of text:

  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start =3D .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end =3D .);
  }
  .init_array     :
  {
     PROVIDE_HIDDEN (__init_array_start =3D .);
     KEEP (*(SORT(.init_array.*)))
     KEEP (*(.init_array))
     PROVIDE_HIDDEN (__init_array_end =3D .);
  }
  .fini_array     :
  {
    PROVIDE_HIDDEN (__fini_array_start =3D .);
    KEEP (*(.fini_array))
    KEEP (*(SORT(.fini_array.*)))
    PROVIDE_HIDDEN (__fini_array_end =3D .);
  }

seems to only to be for those two ldscript.*'s.

--=20
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-bYOpjEQW9w>