From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18916 invoked by alias); 18 Jun 2016 05:11:23 -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 18901 invoked by uid 89); 18 Jun 2016 05:11:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=e_ident X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-qk0-f175.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=AQV1AY8CKexeo8gy14qXB68GmP8Y2HG91QHJxwZCt9s=; b=f/570ctaxIW3e1+86JbH16B46SlMUFIqFsUax+uZaBdmC5itgsmIpmeEBhEJruDS85 /oC2aMcYvZ9xqto25pEIcI6IeJTC4n5/TIfFtd4Z/rpmGHhRTzRuIEIia5dEHkGWfi27 SMRC8coq6HoU74w8Wp40kKSjpni5y2CeK96H9GCOf5Y5C0oR7xRkUz1iEyNhWtXN2Nh1 o/+r0TQSVLI3YKH5HQ/fKMkHA6jTrK6xrVOEUhXBXJsxWF6HGVASPWWxn07Sv7qXWfJ4 9oiuFAWsMaibY0yUpPPmbTsnNvEEO5mmABmikDLJp9hUhMlDBPvmSHnqG+xI4aPkkTvi N71w== X-Gm-Message-State: ALyK8tKAtG+xK/q8GMkq0/r/zfWh0/3cUrJIT6Qr7ZMKaOJ1IeCk8lVNKcjhk2BrWBeQhvoq X-Received: by 10.200.49.50 with SMTP id g47mr7002128qtb.76.1466226678029; Fri, 17 Jun 2016 22:11:18 -0700 (PDT) Subject: Re: OSABI on Linux Distros To: Roland McGrath , hegdesmailbox@gmail.com References: <7160c0e3-b49c-1ab8-c0d3-cee12355f895@gmail.com> <20160610212256.D5A772C39F7@topped-with-meat.com> Cc: gnu-gabi@sourceware.org From: Carlos O'Donell Organization: Red Hat Message-ID: Date: Fri, 01 Jan 2016 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160610212256.D5A772C39F7@topped-with-meat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-q2/txt/msg00025.txt.bz2 On 06/10/2016 05:22 PM, Roland McGrath wrote: >> What is the reason why we emit OSABI value as "UNIX - System V" >> (ELFOSABI_SYSV) even on GNU/Linux systems? Shouldn't it be just "GNU" >> (ELFOSABI_GNU)? > > In GNU systems the use of this field is specifically to indicate that > certain GNU extensions to ELF are used in the particular object. In > particular, if any .dynsym entries use STT_GNU_IFUNC o STB_GNU_UNIQUE, > then e_ident[EI_OSABI] must be ELFOSABI_GNU. Otherwise, it can be > ELFOSABI_NONE (aka ELFOSABI_SYSV). In fact, it should be, and the > tools (linkers) implement that distinction. This makes it possible > for current tools (without special switches or whatnot) to produce > binaries that are compatible with older dynamic linker implementations > that did not support these GNU extensions to ELF. > > This is arguably a bad overloading of the original instead of > EI_OSABI, but it's what's been done for GNU systems and so now it's an > unchangeable part of the GNU ELF gABI. Sure we might have to document this in the GNU ELF gABI, but nothing stops us from changing it and moving forward? Change binutils to generate ELFOSABI_GNU by default, with a "special switch" to allow people to generate pre-2009 glibc ld.so compatible binaries if they need it. You would need a sysroot to build with so they'd be using probably similar vintage tools anyway and don't have to worry. Then all binaries going forward are marked as being ELFOSABI_GNU binaries. The use case of being able to use ELFOSABI_GNU to determine how to decode values between PT_LOOS/PT_HIOS is the most relevant I've seen. Today with ELFOSABI_NONE you don't know how to decode those values, only though if one assumes that PT_LOOS/PT_HIOS values can overlap between any OS. -- Cheers, Carlos.