From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18880 invoked by alias); 4 Oct 2018 02:15:32 -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 18523 invoked by uid 89); 4 Oct 2018 02:15:06 -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=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:a5-v6mr, HX-Received:9005, H*f:sk:Lu7-Czq, H*i:CAJimCsFrFikb4C X-Spam-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_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: mail-pl1-f196.google.com Received: from mail-pl1-f196.google.com (HELO mail-pl1-f196.google.com) (209.85.214.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Oct 2018 02:15:04 +0000 Received: by mail-pl1-f196.google.com with SMTP id c8-v6so4364304plo.9; Wed, 03 Oct 2018 19:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0l24PcCwB7ANwdX+iYMief0pd4dU1Grx/45Iukol630=; b=PJ/G6+PJ7t4bNgYhVIkOhzSyuEwt5Ws5fqR/aK+zKXWrnhVzLI1W3580pF2lR4K5j5 ZH2loIGlU1EhO7WBp70A2r5KFnnacz76Itc/6KI557iLEm9rlmdSORSGxUC28YfTeVhp jCc4joNlGExlyEOJDtxl0JLFDiXDNJ4aa7o6BbDEOu9FNhPbxYtLlJat2RL+amArwc0w WOT068y1sqj+5A4k0mTJEBnSxUc8totNQsmE+A+ErZJQp4dlfRsPlbYgn4fbPcSjlVOC LsKdEVtCfpVS350hIt0q1E8dwVl5IR4bsQVYKolFPnAF7K2cm1lAcIlM7BYHgLORaxEi SbQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0l24PcCwB7ANwdX+iYMief0pd4dU1Grx/45Iukol630=; b=jTCTmTq4UWtkRSE96y4AW/GhnDoViUIksI8uEkW0VaJheVFOnsOAtrRsjiPs4mBik/ lZyVg5e61Faib4tLJuxPsqaKyKSF9j9ty7BIwBqHdjDxK+GNO4Hy3RRNCR5OIcxD4M0A ZKM03qvHmsnwer0uXmxP/sQxAXbAFxcGkmFWsEhLJAoqo5+oqNJgozvUC04S1/9EmYCE A7aLSAr2TBKE/1S6rKdDPYVxBHDtqG14uH8J4sJoJeXHdY35rJUGbxnX/ELLAHIBvSEu nTJ5bSHFXhKHefLDT19eOr47rB63d+yH5h1RCmofjWck9APUe7x6ehQQhKNojc4XvHAI UJLw== X-Gm-Message-State: ABuFfoibfPLzUarTixdv3Mq+/OrsZRdj926gQysQqZs+speMsusAV59+ xbhYJ8PCxmvKW7I1G2aWrz8= X-Google-Smtp-Source: ACcGV62UPq0FvA9A+78gSZpngthtRJlw/E/d+1AAUwSs6jGfouuilmsAzeXzlZ5sHMYwxkK0ghWvNQ== X-Received: by 2002:a17:902:9005:: with SMTP id a5-v6mr4317756plp.86.1538619302848; Wed, 03 Oct 2018 19:15:02 -0700 (PDT) Received: from bubble.grove.modra.org ([58.175.241.133]) by smtp.gmail.com with ESMTPSA id i184-v6sm5687716pfg.88.2018.10.03.19.15.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 19:15:01 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 0112480D65; Thu, 4 Oct 2018 11:44:57 +0930 (ACST) Date: Mon, 01 Jan 2018 00:00:00 -0000 From: Alan Modra To: Cary Coutant Cc: "H.J. Lu" , Michael Matz , Rich Felker , Carlos O'Donell , Florian Weimer , nsz@port70.net, Jan Beulich , Binutils , gnu-gabi@sourceware.org Subject: Re: RFC: Add GNU_PROPERTY_NEED_PHDRS Message-ID: <20181004021457.GE3179@bubble.grove.modra.org> References: <20181003075416.GD3179@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00011.txt.bz2 On Wed, Oct 03, 2018 at 04:46:10PM -0700, Cary Coutant wrote: > > > > 3. Ld won't create a PT_LOAD segment just to hold phdrs. > > > > > > You seem to be breezing right past the idea of doing exactly this. > > > Why? The scripting language already allows you to declare which > > > segment should include FILEHDR and PHDRS. For -z separate-code, why > > > not use a default linker script with something like the following? > > > > > > PHDRS > > > { > > > headers PT_PHDR PHDRS ; > > > interp PT_INTERP ; > > > header_seg PT_LOAD FILEHDR PHDRS ; > > > text PT_LOAD ; > > > data PT_LOAD ; > > > dynamic PT_DYNAMIC ; > > > } > > > > The script idea is probably not practical in view of all the > > variations of headers we'd need. PT_NOTE, PT_TLS, PT_GNU_EH_FRAME, > > PT_GNU_STACK, PT_GNU_RELRO come to mind, some of which depend on > > executable contents. > > I don't understand why you say it's not practical. How does the number > of variations of individual program header table entries matter? If you specify PHDRS in a script, ld uses exactly those program headers, and I believe it should continue to operate that way. So to add PT_GNU_EH_FRAME, say, when an executable has .eh_frame_hdr, you'd need a script with PT_GNU_EH_FRAME specified in PHDRS. And another without PT_GNU_EH_FRAME when the executable doesn't have .eh_frame_hdr. That soon becomes impractial considering the number of optional headers, requiring auto-generation of the PHDRS script snippet. -- Alan Modra Australia Development Lab, IBM