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: [arm] Use .init_array for static constructors.


Paul Brook wrote:

The following patch makes arm targets use the .init_array section for static constructor lists. Non-eabi targets are unaffected. The pointers in this section are relocated by relocated by an R_ARM_TARGET1 relocation.
The eabi doesn't provide a mecahnism for supporting the init_priority attribute, so I've disables support for this on eabi based targets.


The eabi doesn't mention how static destructor lists should be handled, though it's implied that the atexit functionality makes these unnecessary.
I've left the handling of .dtors unchanged.


There is still at least one way to get a static destructor:

void f() __attribute__((destructor));

in GNU C. (In C++, all static destructions should be registered with atexit, as you say.)

I'm not sure what to do about that, though, if the ABI doesn't say.

Tested with cross to arm-none-elf and arm-none-eabi.
Ok for csl-arm-branch? mainline?


Looks good to me for csl-arm-branch. I think this should go on mainline, too, but I think that an ARM maintainer should sign off first.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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