From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103959 invoked by alias); 22 Feb 2016 22:43:59 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 103940 invoked by uid 89); 22 Feb 2016 22:43:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99 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=$0x0, r_x86_64_32, R_X86_64_32, dt_textrel 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-f175.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sv07TkGqBQNuIt7lXCeTC2lJMT5I7ky0tgK+IZjZQXY=; b=wgV8yYO4PsEC6Igp3bQBrNg78e3735IffQNG5IAM2Dq0k8xs3ASf53Y8LXoz3UA30o 5qwiYoRjzU3SGkrXcg7mf/4QJDR05Xr1Dx1rBj8Ha12G4pXHC2X/zsoAHxZwHgdbS4AX UkBjG9m2sjoMVwaAAIcF3U9dSnL52sIeeFTT4Cdq9fXU18lca3Jiw37qdWxX4dQwjlzc 8OWcwAAFZm1YJk32CBJZzOX4+qALYAchyZQkxWMg1R5YK8XUsmF9Ltj2ZrS/UsKe0WKb Lp/VJJawuRMxbp5RgwzigT6Kpl9vQIKKuybhgTkJqvm6k7DnrRGdDSM5YQLDMu3qXwDa gNRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=sv07TkGqBQNuIt7lXCeTC2lJMT5I7ky0tgK+IZjZQXY=; b=TOffx8AU16wPVAnUCHezRBs2V5uqHJkQXBwwR9cqnpsyuY4ngTVrvRoZKEW/psvSFY 2EE7N2X0J7ume6UQT7ddLvfxmDEXBm7I3WBZMBtE5EiyQguCf1T3GjSzP+KP4JLykioG eVydjghPDXGfRTQaDQo2i4UhXACkSvSqnFrt9l+bp/mKNjz8Q2aYloc6W36gfeZxirRO SFl44nk/yibYHnDJwLKkXxjuaRXX+Nw4pLCe/GW8iQhP3RGQW02ZASvHE7qN58FIAhcx ZMBi0bGjik62tkmBrPh+7CFpYGELs4tJkVxLkk8MeHN1fSRw9Qeq3HxmoDX5PhLF9WhT zlBw== X-Gm-Message-State: AG10YOT1cNAe83A2j0lkW91NNcLUQ0GVOMqMeXFnq9E7gIKUHgrh/YsJwwTCCZCdmrzi//B5iohxl3ktOL8cKQ== MIME-Version: 1.0 X-Received: by 10.55.192.89 with SMTP id o86mr14756051qki.31.1456181035198; Mon, 22 Feb 2016 14:43:55 -0800 (PST) In-Reply-To: References: Date: Fri, 01 Jan 2016 00:00:00 -0000 Message-ID: Subject: Re: Specify how undefined weak symbol should be resolved in executable From: "H.J. Lu" To: Michael Matz Cc: gnu-gabi@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-q1/txt/msg00011.txt.bz2 On Mon, Feb 22, 2016 at 10:28 AM, H.J. Lu wrote: > On Mon, Feb 22, 2016 at 10:17 AM, Michael Matz wrote: >> Hi, >> >> On Mon, 22 Feb 2016, H.J. Lu wrote: >> >>> > Typo? What is the meaning of "dynamic relocation available at >>> > runtime". Are you talking about a relocation entry or the relocation >>> > process? >>> >>> Dynamic relocation isn't available with static linking. >> >> So you _are_ talking about the process. I think it's customary to call >> such executables "dynamic", or perhaps non-static, isn't it? (Why I'm >> confused with your wording: a dynamic executable which happens to have no >> dynamic reloc entries, has "no dynamic relocation available at runtime", >> and so we couldn't add one :)) >> >>> > How about "When creating a dynamic executable the link editor should >>> > ..."? >> >> So, I still can understand my version better (possibly with >> s/dynamic/non-static/) :) >> > > Let's go with: > > When creating dynamic executable, the link editor should generate dynamic > relocations against unresolved weak symbols so that their values will be > resolved at run-time. > Second thought. To generate dynamic relocation for R_X86_64_32 against fun in: [hjl@gnu-6 pr19704]$ objdump -dwr foo.o foo.o: file format elf64-x86-64 Disassembly of section .text.startup: 0000000000000000
: 0: b8 00 00 00 00 mov $0x0,%eax 1: R_X86_64_32 fun 5: 48 85 c0 test %rax,%rax 8: 74 10 je 1a a: 48 83 ec 08 sub $0x8,%rsp e: e8 00 00 00 00 callq 13 f: R_X86_64_PC32 fun-0x4 13: 31 c0 xor %eax,%eax 15: 48 83 c4 08 add $0x8,%rsp 19: c3 retq 1a: 31 c0 xor %eax,%eax 1c: c3 retq [hjl@gnu-6 pr19704]$ we create executable with dynamic R_X86_64_32 relocation against fun .text section, which leads to DT_TEXTREL. Is this what we want? -- H.J.