From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7662 invoked by alias); 8 Aug 2012 13:24:10 -0000 Received: (qmail 7645 invoked by uid 22791); 8 Aug 2012 13:24:08 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gg0-f175.google.com (HELO mail-gg0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Aug 2012 13:23:53 +0000 Received: by ggmq1 with SMTP id q1so749104ggm.20 for ; Wed, 08 Aug 2012 06:23:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=wpn+lkvqjfPcZh9nOh0graac8bfjKOnoTRpnbbwnj0g=; b=oMnMvIEC6bl0+CZhxqW7lR/0OPDsUxZfpXoV9ymLedbICc8eJ0DCfxOAXxdwToZ747 6qCoHfAOiPeMgR2ng+Swc/ojakwuBgup53NxyRgNzPSoVaLqHwQc279V6k28NoGhF2sX nNKMxmPpu7/paLyYHdMRBSztFCFgxvZEj3+XqQrmpjJz+au/ymtkLF/i2kb+04kWwK2E dU/DfWHE6ud/PuBEr03+VXEI3x7jAAu/IEBEISVmMj5UD0A+cWNnmJ0e4q7TxjbH5tQI None/EsPshuAVIgkTb1g0hxWk4vZtCILcJI/3cCR7eRrtk7GRQMPZyG6szEzJ4DpOOOO vdig== Received: by 10.66.72.197 with SMTP id f5mr33864548pav.20.1344432232649; Wed, 08 Aug 2012 06:23:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.72.197 with SMTP id f5mr33864519pav.20.1344432232400; Wed, 08 Aug 2012 06:23:52 -0700 (PDT) Received: by 10.68.23.10 with HTTP; Wed, 8 Aug 2012 06:23:52 -0700 (PDT) In-Reply-To: References: <5021FB65.2010704@gmail.com> Date: Wed, 08 Aug 2012 13:24:00 -0000 Message-ID: Subject: Re: The Extension to ELF From: Ian Lance Taylor To: "Frank Ch. Eigler" Cc: Fumiaki Isoya , gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQni+JuSIBpNqNMRaClt46av/e8givSaDlcnmYfgan7UEf/+8YQZWTt0y3bPYgoZrgOzMKNd3SzfyW+bYYw2SSaY74IAT1DAUEaHt5koVZupdWEHTjW3uf2mnIIh8NPc7lRS+swVjS+6ZEftIQiKV7k8xQ1Sj+uzhKWTDSjbZ1pCGlT0EFFCCL/KHAPSZn6GZy71qsnG X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg00078.txt.bz2 On Wed, Aug 8, 2012 at 4:23 AM, Frank Ch. Eigler wrote: > Ian Lance Taylor writes: > >> [...] >> ELF is designed to permit fast program loading at runtime, and to >> permit fast linking. Changing symbol and relocation values to take >> general expressions works against that goal. >> [...] > > It may interest you to know that, for an older Cygnus project (mep), > we implemented a facility called computed/complex relocations, as an > ELF extension. This is a way of encoding general symbol/arithmetic > expressions to be evaluated at link time and substituted into the > binary output. (It may be similar to the vms-alpha ETIR facility.) > > This has been merged into gnu binutils some time ago, though is not > widely known, and only used by a single cgen-based gas port. See the > OBJ_COMPLEX_RELC conditionals in gas/*, the BSF_*RELC/STT_RELC logic > in bfd/*. Thanks, I was trying to remember that. It is perhaps also worth noting that the IEEE-695 object file format supports arbitrary expressions in a number of different ways, including for relocation calculations. The format is not widely used today, for more or less that reason. Ian