This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 3/4] vxworks: enable use of .init_array/.fini_array for cdtors


Hello Rasmus,

> On 28 Jun 2018, at 10:43, Rasmus Villemoes <rv@rasmusvillemoes.dk> wrote:
> 
> Assume that if the user passed --enable-initfini-array when building
> gcc, the rest of the toolchain (including the link spec and linker
> script) is set up appropriately.
> 
> Note that configuring with --enable-initfini-array may prevent the -mrtp
> mode from working,

> due to the (unconditional) use of .init_array.*
> sections instead of .ctors.* -

Just spent some time verifying this, and, indeed getting
a RTP to work with this setup is going to be tough, if at
all possible.

> however, that is the case regardless of this patch.

Right, though the situation becomes a bit different
with the patch as we now have references to the macro,
sort of implying it should work.

I still think it's fine, as what we do is simply honor
what the doc of --enable-initfini-array states: generate
constructor/desctructors in init/fini_array sections,
nothing more, and the comments pretty clearly state that
it's the responsibility of the one who configured this
way to manage the constructors and fit them into the OS
runtime.

And we can revisit if we find a better way out.

So, as it allows at least a use case to operate smoothly
...

> 2018-06-04  Rasmus Villemoes  <rv@rasmusvillemoes.dk>
> 
> gcc/
> 	config/vxworks.c: Set targetm.have_ctors_dtors if HAVE_INITFINI_ARRAY_SUPPORT.
>  config/vxworks.h: Set SUPPORTS_INIT_PRIORITY if HAVE_INITFINI_ARRAY_SUPPORT.

Ok, modulo ChangeLog reformatting:

	* config/vxworks.c: Set targetm.have_ctors_dtors if
	HAVE_INITFINI_ARRAY_SUPPORT.
	* config/vxworks.h: Set SUPPORTS_INIT_PRIORITY if
	HAVE_INITFINI_ARRAY_SUPPORT.

Thanks,

Olivier


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]