From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59771 invoked by alias); 18 Oct 2019 13:30:30 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 59670 invoked by uid 89); 18 Oct 2019 13:30:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=38AM, 38am X-HELO: mail.inka.de Received: from quechua.inka.de (HELO mail.inka.de) (193.197.184.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Oct 2019 13:30:19 +0000 Received: from raven.inka.de (uucp@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1iLSKX-0004E0-8U; Fri, 18 Oct 2019 15:30:09 +0200 Received: by raven.inka.de (Postfix, from userid 1000) id 5FCF8120270; Fri, 18 Oct 2019 15:20:41 +0200 (CEST) Date: Fri, 18 Oct 2019 13:30:00 -0000 From: Josef Wolf To: gcc-help@gcc.gnu.org Subject: Re: Propagating addresses from linker to the runtie Message-ID: <20191018132041.GK11171@raven.inka.de> Mail-Followup-To: Josef Wolf , gcc-help@gcc.gnu.org References: <20191016131759.GA11171@raven.inka.de> <5b75d9aa-9f33-2ec6-ff46-713b113b3539@gmail.com> <20191017113157.GC11171@raven.inka.de> <20191018090705.GF11171@raven.inka.de> <87d0euv2hh.fsf@oldenburg2.str.redhat.com> <20191018094353.GG11171@raven.inka.de> <8736fquy7e.fsf@oldenburg2.str.redhat.com> <20191018125138.GM28442@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191018125138.GM28442@gate.crashing.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00084.txt.bz2 On Fri, Oct 18, 2019 at 07:51:38AM -0500, Segher Boessenkool wrote: [ ... ] > Using reserved names (like those starting with two underscores) is UB > already. What does "UB" mean? > > > To get this conforming, the linker would need to export a symbol to the start > > > of the section and the length of the section, IMHO. > > > > Right, but we do not have that today. 8-( > > We have had it since over 25 years: > > Thu Aug 18 15:37:45 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) > > Make the ELF linker handle orphaned sections reasonably. Also, > define __start_SECNAME and __stop_SECNAME around sections whose > names can be represented in C, for the benefit of symbol sets in > glibc. ??? I was talking about exporting start+length instead of start+stop. Having start+length would allow a confirming implementation, because pointer arithmetic on unrelated objects would no longer be needed: unsigned long *dst = &_s_bss; for (n = 0; n < _l_bss / sizeof (unsigned long); n++) dst[n] = 0; -- Josef Wolf jw@raven.inka.de