From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id F0FDC386EC42 for ; Wed, 16 Sep 2020 13:46:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F0FDC386EC42 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=matz@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 62D6BAC12; Wed, 16 Sep 2020 13:46:54 +0000 (UTC) Date: Wed, 16 Sep 2020 13:46:38 +0000 (UTC) From: Michael Matz To: Florian Weimer cc: Jozef Lawrynowicz , gnu-gabi@sourceware.org Subject: Re: [RFC] SHF_GNU_RETAIN ELF Section Flag In-Reply-To: <875z8dn9xj.fsf@oldenburg2.str.redhat.com> Message-ID: References: <20200915120632.bs36vkrbvmsoyvnu@jozef-acer-manjaro> <877dsvjl71.fsf@oldenburg2.str.redhat.com> <20200915123155.xpow3oxpzycsq3ie@jozef-acer-manjaro> <87v9gfi5cf.fsf@oldenburg2.str.redhat.com> <87mu1ri4ie.fsf@oldenburg2.str.redhat.com> <20200915132955.gmklbme6h5x5izha@jozef-acer-manjaro> <30f44461-67b1-2428-7b0d-9a49520524b3@redhat.com> <20200915165255.fm53szwcabht77ig@jozef-acer-manjaro> <875z8dn9xj.fsf@oldenburg2.str.redhat.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gnu-gabi@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnu-gabi mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 13:46:41 -0000 Hello, On Wed, 16 Sep 2020, Florian Weimer via Gnu-gabi wrote: > * Jozef Lawrynowicz: > > > I suppose the most compelling use cases for SHF_GNU_RETAIN are when the > > dependency cannot be expressed with references to ELF sections. You > > can't use SHF_GROUP because there is nothing to group the section with. > > But if there is nothing to group the section with, why would the link > editor load the object? > > That's the part I don't understand. Hmm? By putting it on the command line: % ld --gc-sections needed.o should retain the RETAIN sections from needed.o, even if otherwise not seemingly referenced. (I'm not sure if doing this via a group flag, or via a section flag would be better here. In a way I find the section flag more appealing, it's the less complicated way to state "don't GC this section"). Ciao, Michael.