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.0 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 823FE1F55A for ; Fri, 21 Feb 2020 18:34:37 +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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=AwD2IbJTpN7HfcYuhnnq1iVAdvswCBGbhEwy9BHuxhb 6cUCmlfjwhQthdVoAE2lDyWJXrY6nWpkO48DkLbPUbgEBPMlMdgfrCJe1aWPC2oK JjWQGhiRoubS2YA+8IDmICe6ZBEjfSwIPHP2FZnjiXKfaxH2qa+T+B6aIllVd80s = 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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=default; bh=Kv/RqwndY8bxAgqY4L+YWjqAsTE=; b=LHLtt8OTZ9l9iUPMs XdKIPedb+TJn3fSBSZCQAnjep1iwlEpx1rtC/gUP8ozvLYdYID40oRg+TTvbq5Mi mxmcaNndLF8CXNrkTTF+SE+BL6So+RqjJmqPmJzPbOqRIlK2z6jA8fbtxfS3oJKs 9OtAbm3A0i8jwz+SK5rH0jaIfQ= Received: (qmail 31303 invoked by alias); 21 Feb 2020 18:34:34 -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 31295 invoked by uid 89); 21 Feb 2020 18:34:34 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582310070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nOkJM9NWw0Ky6FrYldCGdBlgMCFXyrPBusNzeI9vKWs=; b=QjdfrFND+YqRb1Mn8Dkvxxo4/qB3NLt9oVORJS5duaJLhe8uM4ghLOFD+L7tBe8e9oZaxq D8j3PaVga0rS2ibtm0xex6tVzfz645dOOepAIxFRrddktVdLN/zGyOgI0MvBp/tVX5d/hH KPx198j8skAcBm9HT4NBkXL8VDQKVh8= From: Florian Weimer To: Jim Wilson Cc: Andreas Schwab , GNU C Library Subject: Re: [PATCH] Introduce and ELF_INITFINI for all architectures References: <87zhfngjot.fsf@oldenburg2.str.redhat.com> <871rqpfc07.fsf@oldenburg2.str.redhat.com> <87r1ypdrhj.fsf@oldenburg2.str.redhat.com> <87o8tsi03i.fsf@oldenburg2.str.redhat.com> Date: Fri, 21 Feb 2020 19:34:20 +0100 In-Reply-To: <87o8tsi03i.fsf@oldenburg2.str.redhat.com> (Florian Weimer's message of "Fri, 21 Feb 2020 13:41:37 +0100") Message-ID: <8736b3dc2b.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * Florian Weimer: > * Jim Wilson: > >> On Thu, Feb 20, 2020 at 10:53 AM Florian Weimer wro= te: >>> That's because libc.so.6 still has DT_INIT, from which _environ and >>> other variables are set up. I assumed binutils would convert that into >>> DT_INITARRAY because the architecture is not supposed to have DT_INIT. >>> Without that, it's hard to declare that there is no DT_INIT, and the >>> patch essentially breaks ABI (because DT_INIT processing is gone). >> >> DT_INIT is a function address. DT_INITARRAY is a pointer to a table >> of addresses. I don't see how the linker can easily convert between >> them. We would have to increase the size of the init_array table at >> link time, and I don't think we have any linker support for that. >> Maybe we could modify the startfiles to put a weak reference to _init >> at the end of init_array, right before the zero that normally ends the >> list, and fix the linker to stop creating DT_INIT for _init. But that >> sounds a little risky, and defeats the purpose of dropping support for >> _init to reduce code size. I would prefer that glibc not create an >> _init function in the first place. > > I'm not worried about glibc here. It's easy to make glibc consistent > with itself. The patch I posted seems to do the trick, without > regressing anywhere else. > > What I don't know is whether this binutils bug has resulted in DT_INIT > being used *elsewhere*. I don't have a RISC-V distribution to analyze, > so I really don't know. Fedora RISC-V seems dead, this hasn't been > updated in a while: > > > > (I have existing tools for RPM-based distributions, so having one would > be most useful to me to check for DT_INIT references.) I loaded the repository and ran this query: SELECT symboldb.nevra(package), file.name FROM symboldb.elf_dynamic dt JOIN symboldb.elf_file hdr USING (contents_id) JOIN symboldb.file USING (contents_id) JOIN symboldb.package USING (package_id) WHERE hdr.e_machine =3D 243 AND dt.tag =3D 12 ORDER BY 1, 2; nevra | nam= e =20 -----------------------------------------------+---------------------------= ------------------------- glibc-2.30.9000-31.fc32.riscv64 | /lib64/libc-2.30.9000.so jamin-0.97.16-19.20111031cvs.fc31.riscv64 | /usr/lib64/ladspa/jamincon= t_1912.so ladspa-1.13-23.fc31.riscv64 | /usr/lib64/ladspa/amp.so ladspa-1.13-23.fc31.riscv64 | /usr/lib64/ladspa/delay.so ladspa-1.13-23.fc31.riscv64 | /usr/lib64/ladspa/filter.s= o ladspa-1.13-23.fc31.riscv64 | /usr/lib64/ladspa/noise.so ladspa-autotalent-plugins-0.2-20.fc31.riscv64 | /usr/lib64/ladspa/autotale= nt.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/adsr_165= 3.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/adsr_168= 0.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/amp_1654= .so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/blop_fil= es/parabola_1649_data.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/blop_fil= es/sawtooth_1641_data.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/blop_fil= es/square_1643_data.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/branch_1= 673.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/dahdsr_2= 021.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/differen= ce_2030.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/fmod_165= 6.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/interpol= ator_1660.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/lp4pole_= 1671.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/product_= 1668.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/pulse_16= 45.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/quantise= r100_2029.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/quantise= r20_2027.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/quantise= r50_2028.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/random_1= 661.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/ratio_20= 34.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/sawtooth= _1641.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/sequence= r16_1677.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/sequence= r32_1676.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/sequence= r64_1675.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/square_1= 643.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/sum_1665= .so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/sync_pul= se_2023.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/sync_squ= are_1678.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/tracker_= 2025.so ladspa-blop-plugins-0.2.8-26.fc31.riscv64 | /usr/lib64/ladspa/triangle= _1649.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_auto= pan.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_chor= usflanger.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_dees= ser.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_doub= ler.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_dyna= mics_m.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_dyna= mics_st.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_echo= .so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_eq.s= o ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_eqbw= .so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_limi= ter.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_pink= noise.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_pitc= h.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_refl= ector.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_reve= rb.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_rots= peak.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_sigm= oid.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_trem= olo.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_tube= warmth.so ladspa-tap-plugins-0.7.0-24.fc31.riscv64 | /usr/lib64/ladspa/tap_vibr= ato.so ladspa-wasp-plugins-0.9.7-10.fc31.riscv64 | /usr/lib64/ladspa/libwasp_= booster.so ladspa-wasp-plugins-0.9.7-10.fc31.riscv64 | /usr/lib64/ladspa/libwasp_= noisifier.so ladspa-wasp-plugins-0.9.7-10.fc31.riscv64 | /usr/lib64/ladspa/libwasp_= xshaper.so nekobee-dssi-0.1.7-22.fc31.riscv64 | /usr/lib64/dssi/nekobee.so numactl-libs-2.0.12-3.fc32.riscv64 | /usr/lib64/libnuma.so.1.0.= 0 sblim-cmpi-rpm-1.0.1-25.fc31.riscv64 | /usr/lib64/libcimrpm.so.0.= 0.0 sblim-cmpi-rpm-1.0.1-25.fc31.riscv64 | /usr/lib64/libcimrpmv4.so.= 0.0.0 (62 rows) So there are a few packages which have been built in such a way that they have a DT_INIT tag. I don't know if this qualifies as use, and I haven't disassembled the objects to see if the init routine does anything meaningful. Thoughts? Should we still label RISC-V as an !ELF_INITFINI architecture? Thanks, Florian