[PATCH] D35509: Covnert .[cd]tors to .{init,fini}_array using synthetic section.

Mark Kettenis via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 02:43:00 PST 2017


> From: Rui Ueyama <ruiu at google.com>
> Date: Mon, 11 Dec 2017 21:45:48 -0800
> 
> Yes, looks like there are unfortunately still operating systems out there
> that use .ctors/.dtors and we can't kill it yet.

The real problem here is that there is software out there that
(ab)uses .[cd]tors to implement constructors/destructors from assembly
code.  Which is one of the reasons we've not done a wholesale switch
to .initarray/.finiarray on OpenBSD.  Another issue that we still
support gcc 4.2.1 in our base system, even for platforms that now use
clang as the default compiler.  And gcc 4.2.1 doesn't support
.initarray/.finiarray on all platforms (although it probably could be
made to work).

I guess the proposed functionality would make it easier to make the
transition.  Although on OpenBSD we don't really need this to make the
transition.


More information about the llvm-commits mailing list