From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91012 invoked by alias); 26 Nov 2018 22:34:05 -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 90976 invoked by uid 89); 26 Nov 2018 22:34:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=promised, H*i:sk:CAMe9rO, VALID, opportunity X-Spam-Status: No, score=-1.9 required=5.0 tests=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, 3 recipients X-HELO: mail-io1-f41.google.com Received: from mail-io1-f41.google.com (HELO mail-io1-f41.google.com) (209.85.166.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Nov 2018 22:34:03 +0000 Received: by mail-io1-f41.google.com with SMTP id g8so15356033iop.10; Mon, 26 Nov 2018 14:34:02 -0800 (PST) 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=kJhtlep+3T4tMSUNjdv+LPT259tVCvMxpTNRtWffTs4=; b=JbRatRrJhw1j0w3VciXHYuhJ7iN5hwDrigdf5tXDzDDd1jZXdt7Hhiry53Cjco8qWY LJ5m9I1U0e82e9cbDHSXE8i3IVzYHRmmbtSjOdn6R3YWF+mJP3JcVMsEtXggfgfibcNg KJaJlHNeSh7rNFIMUI32Pw8buLdHx3Jpb+I8L4SzHKo4uLSwkExR3xL/V7GkBJovhtMP BpzhK6XnfgNrxvJxGbJsbrd40ugTpHjFpYiFEacoGk7MPriyfRNdMWthbcwshZUp2sqM 4MhvYfXgyHHldWUGuo8SjjQZ5LT5rsG8MZvfNFMEscezjnVKD7e4YSvzF0gztdWEU9Ft 047A== 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=kJhtlep+3T4tMSUNjdv+LPT259tVCvMxpTNRtWffTs4=; b=iMi2rLQyaz0YKzIqez7M9u5yX6iqoRL/b6EIpoIpeQ9Dgpu7AdjmEUtXdZ921XIqow Aj5Qy+kvODeSutwOivWANZgtQYudI+oCLacVFUJMGU6XmdiN2RjNMUp1CJHK1ICX3UQb mUKDeLGMBye+a2NcwhlyxKumNGSPE7km9Nx/gALWO9AF6OGOe4r0fAVYWjIZ1Mo27uv/ 29V2DEFwFqhwtPoFXQCAmsrrwD9A2G6HxFiAD9IsZP+CD08FGKffWYzvTiVquHvxExF2 gNVjw2M4r3y9ljS/lFkZajQrUxXVx2mHfrIKsdL7Abn8zkd8qECZIQUJHs/nGrrsqJZ4 AbMg== X-Gm-Message-State: AA+aEWazf1gpXNl6d7x/R7Eez9iT0eeJLuTJfXH2faHG6xIUwsMclf+/ gf1tRcfDns2l4heXHG73l46wh+hIoD7/NRTQmuI= X-Google-Smtp-Source: AFSGD/Vv4JPm8Yo9I9q7vqrCAXDz1DN+uujd4sZs2IyxJFnyTIF6XifmR/6ccjAh9GUR0Oj/dbA/6BKaDFMKlRNfhIQ= X-Received: by 2002:a6b:3705:: with SMTP id e5mr23169106ioa.240.1543271641360; Mon, 26 Nov 2018 14:34:01 -0800 (PST) MIME-Version: 1.0 References: <87ftvoouda.fsf@oldenburg.str.redhat.com> In-Reply-To: From: Cary Coutant Date: Mon, 01 Jan 2018 00:00:00 -0000 Message-ID: Subject: Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property To: "H.J. Lu" Cc: Florian Weimer , Binutils , GNU C Library , gnu-gabi@sourceware.org, x86-64-abi Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00020.txt.bz2 > > > GNU_PROPERTY_X86_UINT32_VALID was defined to address this issue such that > > > linker sets the bit in values of x86 properties for non-relocatable > > > outputs. But it isn't sufficient: > > > > > > 1. It doesn't cover generic properties. > > > > Okay. Does this imply that the property notes in all pre-existing binaries can't be trusted? > > > 2. When -mx86-used-note=yes is passed to x86 assembler, the > > > GNU_PROPERTY_X86_UINT32_VALID bit is set in GNU_PROPERTY_X86_ISA_1_USED > > > property in object file and linkers without GNU property support generate > > > invalid NT_GNU_PROPERTY_TYPE_0 notes with the GNU_PROPERTY_X86_UINT32_VALID > > > bit set. > > > > Surely this is a GAS bug? Why not fix that bug? > > Linker removes GNU_PROPERTY_X86_ISA_1_USED when its value is empty. > Maybe linker shouldn't do that. Please explain how that answers Florian's question? You lost me. What exactly are you saying the linker should not do? In your Aug. 10 proposal, ISA_1_USED is in the UINT32_OR_AND range, which specifically says the bit should only be set in the output if *all* input files contain the property (although it's unclear whether you meant "this property is present in all relocatable input files" to mean a non-zero property in all input files). > > > 1. Add a GNU_PROPERTY_BY_LINKER property which should only be set by > > > linker for non-relocatable outputs to indicate the property note is > > > valid and generated by new linkers. Loaders can check this property > > > to verify that the property note is valid. > > > 2. Remove GNU_PROPERTY_X86_UINT32_VALID. > > > 3. Define GNU_PROPERTY_X86_ISA_1_BASE for GNU_PROPERTY_X86_ISA_1_USED, > > > which has the same bit as GNU_PROPERTY_X86_UINT32_VALID and use it > > > for -mx86-used-note=yes with x86 assembler. > > > > The alternative approach would be to switch to a new PT_ segment for > > this because those aren't included in relocatable objects. (Maybe it's > > time for another approach.) > > PT_NOTE is used so that binaries with GNU properties are backward > compatible with loaders which don't support GNU properties. They will > run without any new features from GNU properties. With both your Aug. 10 proposal and this one, you're throwing compatibility out the window by saying the loader shouldn't trust those old notes without VALID bits. Can't we use this opportunity to just do it right? At this point, I don't really care if you keep on using SHT_NOTE for the properties in relocatable files, but please, let's use a proper PT_GNU_PROPERTY segment for executables. (Sorry, I promised to yield to the consensus, but the design keeps getting more complicated.) -cary