From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 844552141E for ; Mon, 28 Jan 2019 23:04:10 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=vVer23aOKMLB3vMN 4qJw09ovjWzU3BsKGlwwVLArWQcGNATvoimcWN/FcFWDp/Y4eyLCozYs3KG9YAe4 1BDiRqAxD40CPaMORxM+YlGB33N/JbyFM+mRBtC7uxOoa3c2/39v6PmvtzY6rfoo dsip0WvHIo3+ZrP0mjEPtOh61s0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=CJB9ifcGwjUAtAAvpmk3ut 6WJSw=; b=D5BcF7vVy0ZKmoZiPNF7GnsKeyngesFA+IzdqbGPt+b/n7P7kb5neP Bste8dOZdUJjSy21WnphmXy9RVFMRjpLQn0+JZi8m7jGvMkBFMOLHiUZ/8aS1h1G 96Qdsj9qOKdY9bijH3WVZvLoR4cj4quP+rUf78w+N5956/rtDPMfc= Received: (qmail 80854 invoked by alias); 28 Jan 2019 23:04:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 80845 invoked by uid 89); 28 Jan 2019 23:04:07 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: smtprelay.synopsys.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1548716644; bh=9xTBwNHm7322oKZcKsHS8TDYuuK5Q+QEWZ44X8Xpi0k=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=VKz+kkyUjOBpQqdzrq8P2iqb1/44MVposYSi6n0FikFGu0ooHbc+7EJZz58BDJNRy WMHQY3WB2l9ZdxPNttAz63D1B9HOWd0Ztv9vHsFjZpjB2DFRzUp7CeIIzsbbRR7hBg N3Dq4oEuVzzfmEpBSBUtPwPZaDviUaqlsz+b5nvc4vaMeLSH5K33Pmdae9p5dctqRY ZGkeRlTEd2xBAksV7ycOAFyuX6zck9HxMOmQnNqevefedVE5A4cojQQhEAmw0oKQAg nvQhidfr20JAC5802Bu6RfRx2rHc9FSBhKrqiXVV6znGEnTowbSy2M4CT8Tg4MgClP 4CLJFjEBBx/MQ== Subject: ARC binutils init/fini (was Re: [PATCH 03/21] ARC: ABI Implementation) To: Joseph Myers CC: Cupertino Miranda , , , "Claudiu Zissulescu" , Nick Clifton Newsgroups: gmane.linux.kernel.arc,gmane.comp.lib.glibc.alpha References: <1545167083-16764-1-git-send-email-vgupta@synopsys.com> <1545167083-16764-4-git-send-email-vgupta@synopsys.com> From: Vineet Gupta Openpgp: preference=signencrypt Message-ID: <15846e18-34a8-d368-61c0-1d101a956884@synopsys.com> Date: Mon, 28 Jan 2019 15:03:50 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 12/18/18 3:09 PM, Joseph Myers wrote: >> diff --git a/sysdeps/arc/crti.S b/sysdeps/arc/crti.S > As a new port I think it would be best to use init_array in your Implies > file so you don't need these crti / crtn files, and make GCC generate > init_array / fini_array exclusively. (See RISC-V and C-Sky discussions of > this issue.) > I did the switch and while is working, there are additional test failures | FAIL: dlfcn/bug-atexit1 | FAIL: dlfcn/bug-atexit2 | FAIL: dlfcn/tstatexit | FAIL: dlfcn/tstcxaatexit | FAIL: nptl/tst-atfork2 | FAIL: nptl/tst-cond17 | FAIL: stdlib/test-dlclose-exit-race In the failing case, the dsos are NOT getting the DT_INIT/DT_FINI dynamic tags Consider glibc test dlfcn/tstatexit, which uses a dso modatexit.so In good case | arc-linux-readelf -a modatexit.os | | Section Headers: | [Nr] Name Type Addr Off Size ES Flg Lk Inf Al | [ 9] .init PROGBITS 0000047c 00047c 000044 00 AX 0 0 4 | [12] .fini PROGBITS 000006f8 0006f8 000028 00 AX 0 0 4 | | Dynamic section at offset 0x1f08 contains 23 entries: | 0x0000000c (INIT) 0x47c | 0x0000000d (FINI) 0x6f8 In broken case, init/fini sections exist, but DT_INI/DT_FINI are missing. | | Dynamic section at offset 0x1f2c contains 19 entries: <-- missing INIT/FINI | I suspected some bintuils/gcc shenanigans and tried hacking around, but was led far too astray. (1). gcc config test failing (false alaram) | host-gcc-final-ab544139bfee/build/gcc/config.log | |configure:22941: checking for .preinit_array/.init_array/.fini_array support |configure:23106: checking cross compile... guessing |configure:23111: result: no gcc was seemingly built w/o init_array support leading to inclusion of default gcc/config/initfini-array.h However doing a glibc aarch64 build I see the same output so perhaps it is not relevant. (2). ARC binutils port seems to hardwire _init/_fini (and the only arch to do that) so I ripped out the relevant handling from ld, but that doesn't help. https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/commit/56771171fa7cb9e31c65e26a656a8588d603d924 So I'm not sure if this is deficiency of linker emulation script or code ld/bfd etc.. -Vineet