From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27757 invoked by alias); 30 Jan 2013 17:08:03 -0000 Received: (qmail 26695 invoked by uid 48); 30 Jan 2013 17:07:29 -0000 From: "glider at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/55617] static constructors are not being instrumented correctly on darwin Date: Wed, 30 Jan 2013 17:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glider at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg02789.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55617 --- Comment #20 from Alexander Potapenko 2013-01-30 17:07:25 UTC --- (In reply to comment #19) > Well, if somebody does the work and in a clean way that won't penalize targets > with sane linkers and object formats, I'm not objecting, I just am not going to > spend time on this. If clang can handle ctor priorities right at least inside > of each individual CUs, perhaps those that care about targets which don't > support that in the linker can add similar support to gcc (what I've been > suggesting, if priorities aren't supported by linker, don't emit stuff right > away, but just queue it and at the end sort it and emit. Looks like you're right and the constructors are just being emitted by machopic_asm_out_constructor() in gcc/config/darwin.c, so ASan just has no chance to add his ctor before the default one. I suppose this can be fixed in gcc/config/darwin.c, but we don't have enough knowledge and/or cycles for this. Perhaps the right thing to do is to file a bug against the owner of that file.