From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23821 invoked by alias); 2 May 2011 17:47:24 -0000 Received: (qmail 23808 invoked by uid 22791); 2 May 2011 17:47:23 -0000 X-SWARE-Spam-Status: No, hits=-0.0 required=5.0 tests=AWL,BAYES_50,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from server107k.exghost.com (HELO server107.appriver.com) (204.232.236.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 May 2011 17:47:08 +0000 X-Note-AR-ScanTimeLocal: 5/2/2011 1:46:28 PM X-Policy: arxan.com - arxan.com X-Policy: arxan.com - arxan.com X-Primary: jabbey@arxan.com X-Note: This Email was scanned by AppRiver SecureTide X-ALLOW: @arxan.com ALLOWED X-Virus-Scan: V- X-Note: Spam Tests Failed: X-Country-Path: UNITED STATES->UNITED STATES->PRIVATE->UNITED STATES X-Note-Sending-IP: 10.238.8.42 X-Note-Reverse-DNS: X-Note-WHTLIST: jabbey@arxan.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G195 G196 G197 G198 G202 G203 G214 G302 X-Note: Encrypt Rule Hits: X-Note: Mail Class: ALLOWEDSENDER X-Note: Headers Injected Received: from dummy.name; Mon, 02 May 2011 13:46:28 -0400 Received: from dummy.name; Mon, 2 May 2011 13:47:07 -0400 Received: from dummy.name; Mon, 2 May 2011 17:47:07 +0000 Subject: Re: PE32/PE32+ linking of DLLs (and EFI applications) References: <4DBEDC06020000780003F2F5@vpn.id2.novell.com> From: "Joe Abbey" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" In-Reply-To: <4DBEDC06020000780003F2F5@vpn.id2.novell.com> Message-ID: <97BEEADB-FF81-452F-99E7-6847E3B0FAC8@arxan.com> Date: Mon, 02 May 2011 17:47:00 -0000 Cc: To: "Jan Beulich" MIME-Version: 1.0 (iPhone Mail 8H7) Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00014.txt.bz2 Jan, For PE32, gcc emits PIC code which uses a call instruction to obtain the cu= rrent EIP. After that, an offset is subtracted (usually relative the the GO= T). Thus allowing the binary to be memory mapped at any base address.=20 In PE32+, most compilers generate PIC via RIP-relative addressing mode.=20 Some compilers still require linker-generated base relocations, and ld will= create them if the COFF relocation is of the correct type.=20 I have no familiarity with EFI applications, however.=20 Does this help? Joe Sent from my iPhone On May 2, 2011, at 7:29 AM, "Jan Beulich" wrote: > How do ld-linked DLLs work when there don't seem to be any base > relocations getting emitted? While imo for DLLs this should be the > default anyway, is there a magic switch that I'm overlooking? EFI > applications also require relocations to be emitted... >=20 > While the hack called "dlltool" isn't really an option anyway, it's not > even possible to use it as the file generated with --base-file is empty > (I assume because data gets written to it only for COFF input files, > but on Linux all of the inputs are [obviously] ELF). >=20 > Thanks, Jan >=20