From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22039 invoked by alias); 26 Sep 2018 18:36:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 22005 invoked by uid 89); 26 Sep 2018 18:36:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,LIKELY_SPAM_BODY,SPF_PASS autolearn=no version=3.3.2 spammy=nc, IBT, ibt, displaying X-HELO: mail-oi1-f178.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4WhORvD7C8y/KVkzaVsCs1eRqpL6aOMVK6Je4FqN+L8=; b=hkcbU33LC0d5saDf05R/x+DU+4bxuG8GpRcZgE/FCZU389GrqlhfzfyItWEg7r2MKe EEMxSkyPPJ70eM5EWWLrV8Gk2h0w2RzUAOPWUYUIvSdz38bTAmbBlo62tLU7j+t1J7NT 8IOYcJOfsq3MctEiW40geiOCY+sYNKCDR496YQqydD6JRVEbtkGjv77PBpOKNLNzGAHB R5p49UnYFXboKGSJYml2OcIhNwZuErBPZVkJlYQYX2KsVHI32l4KThHwQka+DZVnhoKr Iz4c7HQSLOpFnkQnWd0IBeHVFOF55GZbpmsThdK7a/5tMfL7/nazjM1du+yNi8HFV3Sq Nyng== MIME-Version: 1.0 In-Reply-To: References: <13a92cb0-a993-f684-9a96-e02e4afb1bef@redhat.com> <87sh2547ib.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Wed, 26 Sep 2018 18:36:00 -0000 Message-ID: Subject: Re: PT_NOTE alignment, NT_GNU_PROPERTY_TYPE_0, glibc and gold To: Cary Coutant Cc: Florian Weimer , x86-64-abi , Binutils , GNU C Library , Mark Wielaard , Michael Matz , Nick Clifton , "Carlos O'Donell" , "szabolcs.nagy" Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-09/txt/msg00497.txt.bz2 On Wed, Sep 26, 2018 at 10:39 AM, Cary Coutant wrote: > > Some requirements I'd like to see: NT_GNU_PROPERTY_TYPE_0 is documented at https://github.com/hjl-tools/linux-abi > (1) An NT_GNU_PROPERTY_TYPE_0 note section must be named > ".note.gnu.property" with type SHT_NOTE. If it isn't specified this way, please send a patch. > (2) A ".note.gnu.property" section must contain one and only one note, > whose type must be NT_GNU_PROPERTY_TYPE_0. True for linker output and all properties must be sorted. For relocatable inputs, there may be more than one NT_GNU_PROPERTY_TYPE_0 notes: [hjl@gnu-cfl-1 tmp]$ touch n.c [hjl@gnu-cfl-1 tmp]$ gcc -fcf-protection -c n.c -Wa,-mx86-used-note=yes [hjl@gnu-cfl-1 tmp]$ readelf -n n.o Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: x86 feature: IBT, SHSTK GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0 Properties: x86 ISA used: x86 feature used: x86 [hjl@gnu-cfl-1 tmp]$ > (3) A ".note.gnu.property" section must have sh_align of 8, and its > length must be a multiple of 8. If it isn't specified this way, please send a patch. > (4) A linker is expected to combine ".note.gnu.property" sections in a > manner described by the ABI documentation, and place the combined > result, as a single note, in a unique SHT_NOTE section named > ".note.gnu.property", and in a unique PT_NOTE segment. > Why is a unique PT_NOTE segment required? A PT_NOTE segment may have more than one SHT_NOTE sections with the same section alignment and each SHT_NOTE section is padded to section alignment. -- H.J.