From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117496 invoked by alias); 27 Sep 2018 12:57:24 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 117474 invoked by uid 89); 27 Sep 2018 12:57:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:Hv2NScV, H*f:CAMe9rOrATHE, H*i:sk:Hv2NScV, H*i:CAMe9rOrATHE X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 12:57:22 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6EF3E3001905; Thu, 27 Sep 2018 12:57:21 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C98B35D6A9; Thu, 27 Sep 2018 12:57:19 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: Szabolcs Nagy , Jan Beulich , Rich Felker , Binutils , gnu-gabi@sourceware.org Subject: Re: RFC: Add SHT_GNU_PHDRS References: <87tvmbv8hp.fsf@oldenburg.str.redhat.com> <5BAC7D6802000078001EC6D1@prv1-mh.provo.novell.com> <87pnwzuz8r.fsf@oldenburg.str.redhat.com> <20180927103539.GJ10209@port70.net> <87va6rqfg6.fsf@oldenburg.str.redhat.com> Date: Mon, 01 Jan 2018 00:00:00 -0000 In-Reply-To: (H. J. Lu's message of "Thu, 27 Sep 2018 05:54:05 -0700") Message-ID: <87r2hfqes1.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 27 Sep 2018 12:57:21 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2018-q3/txt/msg00018.txt.bz2 * H. J. Lu: > On Thu, Sep 27, 2018 at 5:42 AM, Florian Weimer wrote: >> * H. J. Lu: >> >>> On Thu, Sep 27, 2018 at 3:35 AM, Szabolcs Nagy wrote: >>>> an alloc .phdr section covering the program headers solves >>>> this problem. if sections are not required for segments >>>> then simply the linker should ensure that there is always >>>> a load segment covering the program headers, possibly >>>> without containing any sections, however elf says >>>> "An object file segment contains one or more sections". >>>> >>>> i don't understand why a zero-size section is enough, what >>>> if phdr > pagesize? will that get covered by the load >>>> segment that is created for the zero-size section? >>> >>> Linker must keep this zero-size section in output and >>> create a PT_LOAD segment to cover it even if it is >>> the only SHF_ALLOC section in the PT_LOAD segment. >> >> Based on Szabolcs' comment, I don't think the section can be zero-sized. >> > > Why can't we put a zero-size section in a PT_LOAD segment? > Of course, we need to change linker to do it. I'm now under the impression that the bits that are PT_LOAD'ed all need to be covered by (allocated) sections. A zero-sized section doesn't cover anything, so it doesn't address this requirement of the ELF specification. Thanks, Florian