From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106461 invoked by alias); 4 Oct 2018 19:12:58 -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 106432 invoked by uid 89); 4 Oct 2018 19:12:57 -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=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:guP50Ua, ccoutantgmailcom, ccoutant@gmail.com, 43am X-Spam-Status: No, score=-2.6 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-oi1-f176.google.com Received: from mail-oi1-f176.google.com (HELO mail-oi1-f176.google.com) (209.85.167.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Oct 2018 19:12:56 +0000 Received: by mail-oi1-f176.google.com with SMTP id e17-v6so8420977oib.4; Thu, 04 Oct 2018 12:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QYI6B5lAYs6beS8vpcJnXshdm82vVbdHekrKNuLM3OA=; b=E7vs580tCtWD9ZDxQVv2Ao1lQeCUxrMr/zB8WLejhoKc0snMOr1XZ1yk9/HqaKIwwG IjG4VNypZ31gJYQU7QGJObVSv8d+1DywDy+WtN7nOAG4gb45ANPEzOpuX8wVzPhVYx31 caJMYsgsWtklr1HUAxTICccdHgXsFs7sgxMitWFQXoM1yeXTffvFhijXbZREjNNwKrzU EqDJXehE7hpV3hRkEnqxbqrFx9iC7EBms74zaS/FK45jZ1L9dMkrIH6005A8bHRS0Ujf Jq8D94XuepTE3lmX+yZv/7Q+LDG8wJU1v07rhU2wSjThRYUFW1/GGoG27QH+3WGxxTZN 44iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QYI6B5lAYs6beS8vpcJnXshdm82vVbdHekrKNuLM3OA=; b=BToi7Y9nKe5FnyDfmOOwQ5FSpprEiHdoCvUmSs1mveXjrYR83a+W7lpzSpR7i8uPhe oO+7HgETMcBn6xOVCsp5UHbbxAt31pJj6yUSiTotZk5Z0uzO6nk0vLL+kqYh8Yf2VGZ8 nwzbzEsW0SQWrliCNoOEpgqU1M8ji6AMAT9qbRUx64vK3MYIQQ7J/ej+SbVgQdC6Md6H oq2jrLQJhou2req8pBVPZHIG5Vs9yvPlSijUuibH+Tjpp9RpxkeyFDUrYi6QfpBvzgtP MiEZwo9F2NL/oOq5up1554F/61feXMrJFwrAUg6AN5xa0Pg/eOxS5ya/NxoVwRmLeWT2 TblA== X-Gm-Message-State: ABuFfojQSVexmAowyjTuis89XJb0/WZOgbRN9CiCSkRijx+v1RN5AGFR 51FUoLl0pM5kZgVKoobiuggFj/byIgHaqvM18Ns= X-Google-Smtp-Source: ACcGV61ZxRYFE4VLv0DJKEZFu/+ByPwTnPVYKxhe2mOB2wJ+KJ9KeKmlycnmVqQq5h9eIUQ7mgMhKOTaA3KbZpZcP+c= X-Received: by 2002:aca:af91:: with SMTP id y139-v6mr4003432oie.322.1538680374295; Thu, 04 Oct 2018 12:12:54 -0700 (PDT) MIME-Version: 1.0 References: <20181003075416.GD3179@bubble.grove.modra.org> <20181004021457.GE3179@bubble.grove.modra.org> <20181004171640.GE17110@brightrain.aerifal.cx> In-Reply-To: <20181004171640.GE17110@brightrain.aerifal.cx> From: "H.J. Lu" Date: Mon, 01 Jan 2018 00:00:00 -0000 Message-ID: Subject: Re: RFC: Add GNU_PROPERTY_NEED_PHDRS To: Rich Felker Cc: Cary Coutant , Alan Modra , Michael Matz , "Carlos O'Donell" , Florian Weimer , Szabolcs Nagy , Jan Beulich , Binutils , gnu-gabi@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00015.txt.bz2 On Thu, Oct 4, 2018 at 10:16 AM Rich Felker wrote: > > On Thu, Oct 04, 2018 at 09:33:43AM -0700, H.J. Lu wrote: > > On Thu, Oct 4, 2018 at 8:10 AM Cary Coutant wrote: > > > > > > > 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. > > > > > > Oh, I see. Yeah, that does make it impractical. > > > > > > Still, I'd like to understand why HJ claims it's intrusive to have ld > > > create a PT_LOAD segment for the headers. I haven't tried it yet in > > > gold (don't support -z separate-code), but it doesn't seem like it > > > would be at all difficult or intrusive. > > > > The linker part is relatively easy. The problems are with strip and > > objcopy. They aren't prepared to deal with it. > > Can you elaborate on what would go wrong with them? AIUI they can't > remove anything from segments; they can only remove non-loaded > sections. (I found this out the hard way a long time ago trying to get > strip to remove unneeded .eh_frame) Sorry. I don't remember the details. -- H.J.