From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127693 invoked by alias); 13 Apr 2016 18:31:57 -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 127584 invoked by uid 89); 13 Apr 2016 18:31:57 -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.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:3313 X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,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-HELO: mail-qk0-f173.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=flSV/9r/mUUUOrM+aEdN9rhr76c3/GZpqSmKNGzuoR0=; b=z6O9H5LFs8ZuyikrB5yi0fJiLzqT1hqjSnYZMF7P5dZvwivpdFwPzfL4wA8Zw4DS4D henSOLajHvd7UxQL0r8wunqP0hig7Tulo2JjIAp6QQqaiMe/Z2fa1t5TShQAo/fWmkgS GjaWg/RKW3OmOalleXGUZy0xby/B/0Y+clFSz/jMEH/IyGV9xIxwbwrYhTXOYX1fVz6w QPkQEFJ+ndRXvuSJFCgDvycBGv4RAR6vG51Lx1a9seYYXMyKa7LzaAGPhhGF39zfHq8u WIT+pKAJLHHUCozg4c3DtQa26Pc2UAhoXGbFAcJyfsbTf/xZKw936+NPbTFNOXrAFP82 vaVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=flSV/9r/mUUUOrM+aEdN9rhr76c3/GZpqSmKNGzuoR0=; b=CGpY0JcJ4Uw1ondR6H8otLdi6yfnrIYjYtnyysRrlCcGQuawDAZRI+/aYJ697mvpjW JpQUKhU9qgNyhleTOEl5d7Wb81dqyx55xZ8UUjVxB4tOPMVSu0yo9H0fXcbYkGVbGVIv cJt4CQhZMpvglRy+2oOEhZ2nYY2ymjCqjB2+kT0VKlaxdcU138/IBNgi6dpLZA8zUVs7 ZSHbuqpD5u1Ti6Tlb5ZYtJXJjZVf67D003cPdOjH6lCGR/27sq1odGIuX7kEIyEBPPoC +GpQAIs/87pHZPm55jycAfp1lpQqM0mWXURwKXUBtzN7OffT082QP8w/0emMggJFGLEY djbA== X-Gm-Message-State: AOPr4FVeI8yYrLDA5KLk1XzELfZj9JJxl1w6xLXrwnm5qnZ/nfm7F5kcEebHUAkQZTCKnOxnUl/yOneZ1NTumg== MIME-Version: 1.0 X-Received: by 10.55.78.207 with SMTP id c198mr13257716qkb.34.1460572299792; Wed, 13 Apr 2016 11:31:39 -0700 (PDT) Date: Fri, 01 Jan 2016 00:00:00 -0000 Message-ID: Subject: RFC: Add a .note.gnu.property section From: "H.J. Lu" To: gnu-gabi@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-q2/txt/msg00000.txt.bz2 There are cases where linker and run-time loader need more information about ELF objects beyond what the current gABI provides: 1. Minimum ISAs. Executables and shared objects, which are optimized specifically to run on a particular processor, will not run on processors which don't support the same set of ISAs. Since x86 only has EM_IAMCU, EM_386 and EM_X86_64 ELF machine codes, run-time loader needs additional information to tell if an executable or a shared object is compatible with available ISAs. 2. Stack size. Compilers may generate binaries which require larger stack size than normal. If run-time loader can query the stack size required by executable or shared object, it can increase stack size as needed. 3. Additional linking command line options embedded in relocatable object files: a. Additional libraries should be linked in when creating executable or shared object. http://sourceware.org/bugzilla/show_bug.cgi?id=12485 b. Additional compiler command line options are needed to properly link LTO objects. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41756 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47785 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54231 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53777 4. Relocatable object files compiled against header files from a specific version of a library must be linked with a compatible library when creating executable or shared object. 5. Copy relocation and protected visibility are fundamentally incompatible. On on hand, copy relocation is the part of the psABI and is used to access global data defined in a shared object from the executable. It moves the definition of global data, which is defined in a share object, to the executable at run-time. On the other hand, protected visibility indicates that a symbol is defined locally in the shared object at run-time. Both can't be true at the same time. The current solution is to make protected symbol more or less like normal symbol, which prevents optimizing local access to protected symbol within the shared object. GNU attributes GNU binutils supports build attribute and run-time platform compatibility data in relocatable object files. Issues with GNU attributes: 1. Many architectures, including x86, don't support GNU attributes: a. There are some overlaps between GNU attributes and program properties. b. GNU attributes may be extended to embed additional linking command line options in relocatable object files. 2. On x86, linking a relocatable object full of AVX instructions doesn't always make the resulting executables or shared libraries to require AVX to run since AVX functions may be called only via GNU_IFUNC at run-time. Linker can't set minimum ISAs just from ISAs used by input relocatable objects. 3. There is no program segment for GNU attributes in executables and shared objects. 4. Most of attributes aren't applicable to run-time loader. 5. The format of GNU attributes isn't optimal for run-time loader. A separate string table is used to store string attributes. I propose to add a .note.gnu.property section. It is on hjl/property branch at https://github.com/hjl-tools/linux-abi The pdf file is at https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI Any comments, feedbacks? -- H.J.