Return-Path: X-Original-To: apmail-lucy-dev-archive@www.apache.org Delivered-To: apmail-lucy-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21E329CE2 for ; Mon, 23 Apr 2012 19:50:32 +0000 (UTC) Received: (qmail 78357 invoked by uid 500); 23 Apr 2012 19:50:32 -0000 Delivered-To: apmail-lucy-dev-archive@lucy.apache.org Received: (qmail 78280 invoked by uid 500); 23 Apr 2012 19:50:31 -0000 Mailing-List: contact dev-help@lucy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucy.apache.org Delivered-To: mailing list dev@lucy.apache.org Received: (qmail 78270 invoked by uid 99); 23 Apr 2012 19:50:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 19:50:31 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.215.51] (HELO mail-lpp01m010-f51.google.com) (209.85.215.51) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 19:50:25 +0000 Received: by laap9 with SMTP id p9so8656574laa.10 for ; Mon, 23 Apr 2012 12:50:04 -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:from:date:message-id:subject:to :content-type:content-transfer-encoding:x-gm-message-state; bh=K8FwRBRwGv5DWWvhAj1Jw1ojIbt4uUdkj7CSuJURCPs=; b=gOHtBLnixhQobahSiw4+0rW+9rTMopv8e0mCg03jYvpbnvivfe3t3MbMQlV5fqJ4Xo /PlEvtoIhhkgmGfVgX4WDUSu39lxH/FVt9bWVHoev5g1l9vpv8HnSLkvt5UJCxZ2+iJN esu0cGlpy1FvaU+cFtnMJoTvY/GC2r2dMqs/oQTfKdZE85ULlKEASChh+QKgJmLOs9we jlUZjrz26II2VzQPfisbuNByiJIuiVhJr9KViPzQYLxUJpOXKr0gtH0b0j7HlOeFT4O9 biphyFUrlRXyF6yUxvlkP3JbAj8MnJnekgz9aGbV/TMsVGDb8HnO4Z9XfkUKYyXFcpmb kpAQ== Received: by 10.152.124.76 with SMTP id mg12mr6013316lab.6.1335210604734; Mon, 23 Apr 2012 12:50:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.21.230 with HTTP; Mon, 23 Apr 2012 12:49:34 -0700 (PDT) In-Reply-To: References: <4F903955.5020608@aevum.de> <4F913440.10100@aevum.de> <4F941F97.4090504@aevum.de> <4F95385B.7070701@aevum.de> From: Nathan Kurz Date: Mon, 23 Apr 2012 12:49:34 -0700 Message-ID: To: dev@lucy.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlJvt+H6agK/fn/wOm1jz4YJqyFvnpHSYaKLTjk3urrQ8zjSH7eoB52wR2QUsEEMdBz41Zx Subject: Re: [lucy-dev] OFFSET globals On Mon, Apr 23, 2012 at 7:55 AM, Marvin Humphrey w= rote: > My understanding is that in the event that two ELF DSOs export the same > symbol, the general rule is that the last library loaded wins[1]: I'm pretty sure that at runtime it's the first definition found that wins, which is why LD_PRELOAD can be used to override functions like malloc(). > =C2=A0 =C2=A0http://www.akkadia.org/drepper/dsohowto.pdf "Note that there is no problem if the scope contains more than one definition of the same symbol. The symbol lookup algorithm simply picks up the first definition it finds." p.6, 1.5.2 > [1] "How to Write Shared Libraries" by Ulrich Drepper, section 1.4.5. Thought maybe you were referencing a different version of the paper, then figured out that you meant "1.5.4" (transposition). --- I've been planning to chime in on this, but haven't had time to do it justice. My quick thoughts are that: 1) This can and should be solved through DSO symbol versioning. 2) It's great to get things right so as to have a solid foundation, but 3) We got along just fine for years without actually implementing this, thu= s 4) We don't need to solve this right now, just future-proof ourselves. I'm rusty and busy, though, and might not be of immediate help. In addition to Ulrich's paper, Ian's series here might be a good refresher: http://www.airs.com/blog/page/4?s=3D%22linkers+part%22 I haven't found a good overview of the links, but versioning is covered in Part 9: Symbol Versions http://www.airs.com/blog/archives/46 Part 13: Symbol Versions Redux http://www.airs.com/blog/archives/50 --nate