Message ID | yddd3hgydws.fsf@manam.CeBiTec.Uni-Bielefeld.DE |
---|---|
State | New |
Headers | show |
Hi, Rainer - On Mon, Jul 11, 2011 at 06:34:27PM +0200, Rainer Orth wrote: > [...] > On the other hand, there's the question why tree-mudflap.c tries to > create a constructor with a non-default priority on a platform with > SUPPORTS_INIT_PRIORITY == 0 or at all [...] For the "at all" part, I believe the intent was to make it more likely that mudflap-tracked literals be tracked early enough so that other constructors would find them already available for checking. - FChE
Hi Frank, > On Mon, Jul 11, 2011 at 06:34:27PM +0200, Rainer Orth wrote: >> [...] >> On the other hand, there's the question why tree-mudflap.c tries to >> create a constructor with a non-default priority on a platform with >> SUPPORTS_INIT_PRIORITY == 0 or at all [...] > > For the "at all" part, I believe the intent was to make it more likely > that mudflap-tracked literals be tracked early enough so that other > constructors would find them already available for checking. I see. I'm still undecided who's responsibility it is to deal with the !SUPPORTS_INIT_PRIORITY case. On one hand one might argue that only the callers can decide if a non-default priority is strictly required or just an improvement, OTOH silently ignoring the priority and causing constructors not to be run at all doesn't seem a winning proposition either ;-) Rainer
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -152,6 +152,13 @@ along with GCC; see the file COPYING3. #undef TARGET_ASM_NAMED_SECTION #define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section +/* Unlike GNU ld, Sun ld doesn't coalesce .ctors.N/.dtors.N sections, so + inhibit their creation. Also cf. sparc/sysv4.h. */ +#ifndef USE_GLD +#define CTORS_SECTION_ASM_OP "\t.section\t.ctors, \"aw\"" +#define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\"" +#endif + /* We do not need NT_VERSION notes. */ #undef X86_FILE_START_VERSION_DIRECTIVE #define X86_FILE_START_VERSION_DIRECTIVE false