On Mon, Aug 22, 2011 at 11:59 AM, Joseph S. Myers <jos...@codesourcery.com> wrote: > On Mon, 22 Aug 2011, H.J. Lu wrote: > >> > Require a good assembler on ELF targets and just enable this by default >> > for them without trying a configure test that won't work for cross >> > compilation (AC_RUN_IFELSE is bad). >> > >> > The toplevel config/elf.m4 provides a good notion of what is or is not >> > ELF (if there are problems, we can fix that file). Only a handful of >> > targets support non-GNU assemblers; for the vast bulk of targets we should >> > assume a not-too-old GNU assembler. That way, the configure test can be >> > used to cause a configure-time error if the assembler is defective and it >> > doesn't matter that the test is late. >> > >> >> A working .init_array support needs assembler, linker and libc. >> That is why AC_RUN_IFELSE is used. > > A working .init_array is a standard part of ELF. The correct default for > cross compilation to an ELF target (as determined by elf.m4) is to assume > it is present; this is not a matter of a GNU extension that could affect > interoperation with other tools. >
I wish we can make .init_array support mandatory. One problem is to support mixing input .ctors/.init_array sections to generate output .init_array section. Not all linkers support it. This is a new feature. I don't want to cause any more trouble. Currently, one can force to enable .init_array support by setting enable_initfini_array to yes. -- H.J.