From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3708 invoked by alias); 3 May 2011 07:45:55 -0000 Received: (qmail 3694 invoked by uid 22791); 3 May 2011 07:45:53 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from vpn.id2.novell.com (HELO vpn.id2.novell.com) (195.33.99.129) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 May 2011 07:45:39 +0000 Received: from EMEA1-MTA by vpn.id2.novell.com with Novell_GroupWise; Tue, 03 May 2011 08:45:37 +0100 Message-Id: <4DBFCEBC020000780003F559@vpn.id2.novell.com> Date: Tue, 03 May 2011 07:45:00 -0000 From: "Jan Beulich" To: "Joe Abbey" Cc: Subject: Re: PE32/PE32+ linking of DLLs (and EFI applications) References: <4DBEDC06020000780003F2F5@vpn.id2.novell.com> <97BEEADB-FF81-452F-99E7-6847E3B0FAC8@arxan.com> In-Reply-To: <97BEEADB-FF81-452F-99E7-6847E3B0FAC8@arxan.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes 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/msg00023.txt.bz2 >>> On 02.05.11 at 19:46, "Joe Abbey" wrote: > Jan, >=20 > For PE32, gcc emits PIC code which uses a call instruction to obtain the= =20 > current EIP. After that, an offset is subtracted (usually relative the th= e=20 > GOT). Thus allowing the binary to be memory mapped at any base address.=20 >=20 > In PE32+, most compilers generate PIC via RIP-relative addressing mode.=20 >=20 > Some compilers still require linker-generated base relocations, and ld wi= ll=20 Or assembly code, as in the case I'm looking at. > create them if the COFF relocation is of the correct type.=20 No, at least not as far as I was able to find out. If you know differently, can you please point me to how this works and/or where this is implemented? Jan > I have no familiarity with EFI applications, however.=20 >=20 > Does this help? >=20 > Joe >=20 > Sent from my iPhone >=20 > On May 2, 2011, at 7:29 AM, "Jan Beulich" wrote: >=20 >> 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