From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69840 invoked by alias); 1 May 2017 18:28:12 -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 68594 invoked by uid 89); 1 May 2017 18:28:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=faced X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no 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-qk0-f195.google.com Received: from mail-qk0-f195.google.com (HELO mail-qk0-f195.google.com) (209.85.220.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 May 2017 18:28:10 +0000 Received: by mail-qk0-f195.google.com with SMTP id o85so18246369qkh.0; Mon, 01 May 2017 11:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:references:to:cc:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0C8RN5OAMRpPFMZFd//dKsraHqjPwa4CBcXYxdwZgMg=; b=Gt79WQthv2OmEI0V6xbMSuHstrYTGOPkA4PY70PplesbhPIckVagytgSV4YkISiUam ffn2E992JP9ZIScaTQTQF7HWCcaUUGGLRBGxqpbcIowXsvVAOaa99jOK6f4bdOfWS8DJ epfxpCPvxGTkdw46I0zvLCedCk8zjXpRNkVvsMhiEZdE41f2FxgME6mQMEDd0hnmisW8 qARhrNuaIMCE75Q6OMz1T7s0POC9nZTbXK23TU/rEYgCuoPNs+00nPpj9dkfCUv8WovS dIxp1TrUHz9eieRU/6yyhmTRPpHWH2VPpVYL3N0YFectu5Dv8DEG5dPqOCb4Zr/pVQgB Al+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:references:to:cc:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=0C8RN5OAMRpPFMZFd//dKsraHqjPwa4CBcXYxdwZgMg=; b=tKspcxGCTFATARj9AEcJqqdHwjF7QgJWHwn9dQNAzegipXsVtyyvJsDBUfgDZldFQx MBnQNs5g3vDIkh7EAmtOD+yxXoqum0+gEIXL8qtGMu9QxKGFVlxJ8iPpLjAj96bSpKPU +YELGC8/wG68GqYc/MwrT5izeT+T16V5GFgW5ALq50WJL46vl4z6RSGAS5k1zxcIRJfM ruPHQrVxNUDWFAuVu7DSfe1/4LHGtKFwjp5MBG5Ci75KlZbv5AGrZc94nPNLqTZ7WGRi ss3+r9yuALDpL6x/kIqv/ZaDI/0AA1eE2XZDTsw3tLo3HoGN0ZY1RwVgbLy6JSoea+uW NpEw== X-Gm-Message-State: AN3rC/5XzCFWaUNVt/38uvgUcXJDQh5kXC4XyAWJikO6TLwIXcEv08dG 9xaPo4d/l4+9Vg== X-Received: by 10.55.86.69 with SMTP id k66mr22221814qkb.232.1493663291240; Mon, 01 May 2017 11:28:11 -0700 (PDT) Received: from [192.168.1.2] ([103.16.201.114]) by smtp.gmail.com with ESMTPSA id o91sm11465672qte.42.2017.05.01.11.28.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 May 2017 11:28:10 -0700 (PDT) Reply-To: hegdesmailbox@gmail.com Subject: Re: Reducing code size of Position Independent Executables (PIE) by shrinking the size of dynamic relocations section References: <8737cosnym.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me> To: David Edelsohn , Rafael Avila de Espindola Cc: Binutils Development , Alan Modra , Florian Weimer , Cary Coutant , Sriraman Tallam , gnu-gabi@sourceware.org, Xinliang David Li , Sterling Augustine , Paul Pluzhnikov , Ian Lance Taylor , "H.J. Lu" , Rahul Chaudhry , Luis Lozano , Peter Collingbourne , Rui Ueyama From: Suprateeka R Hegde Organization: HEGDESASPECT Message-ID: Date: Sun, 01 Jan 2017 00:00:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Antivirus: Avast (VPS 170501-0, 01-05-2017), Outbound message X-Antivirus-Status: Clean X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00013.txt.bz2 Is the AIX available on x86-64? Otherwise it may not be much useful to refer the linker design. And it is just not linker when it comes to relocs, it indeed involves entire runtime architecture and ISA of the platform. HP-UX on Itanium also uses PIC by default and we have never faced any such exponential difference between relative and non-relative relocs, and its been almost 2 decades now. I just did some numbers. On a Ubuntu 16.10, I just took the ratio of RELATIVE vs non-RELATIVE on x86-64. I apologize if this number is already discussed. readelf -Wr /usr/bin/* 2>&1 | grep RELATIVE | wc -l 1238652 readelf -Wr /usr/bin/* 2>&1 | grep -v RELATIVE | wc -l 51551 So the ratio shows ~96% is RELATIVE reloc. And only ~4% others. This is not the case on HP-UX/Itanium. But as I said, this comparison does not make sense as the runtime architecture and ISA are totally different. At this point, I would say the combination of original ideas proposed and some work already done in this direction is the way to go. On HP-UX, our tool chain greatly reduces dyn relocs with IPO kind of options too. -- Supra On 01-May-2017 07:43 PM, David Edelsohn wrote: > GNU ld supports earlier versions of AIX XCOFF, so one can look at that code. > > The current documentation for XCOFF is > > https://www.ibm.com/support/knowledgecenter/ssw_aix_72/com.ibm.aix.files/XCOFF.htm > > - David > > > On Mon, May 1, 2017 at 9:31 AM, Rafael Avila de Espindola > wrote: >> Where is it documented? >> >> Thanks, >> Rafael >> >> David Edelsohn writes: >> >>> AIX uses relative relocations and generates position independent >>> executables by default. The design of the AIX linker might provide >>> some additional inspiration. >>> >>> Thanks, David