public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [patch libffi]: Make sure code is position-independent for x64 targets
@ 2013-03-22  7:43 Kai Tietz
  2013-03-22  9:19 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Tietz @ 2013-03-22  7:43 UTC (permalink / raw)
  To: GCC Patches; +Cc: libffi-discuss, Andrew Haley

Hi,

this patch fixes the Win64-code so that we use only pc-relative
addressing.  This
is of importance if code gets linked to an pe-image with an image-base
above 2GB.

ChangeLog

2013-03-22  Kai Tietz  <ktietz@redhat.com>

	* src/x86/win64.S: Make use of ffi_closure_win64_inner
	symbol pc-relative.

Tested for x86_64-w64-mingw32, and for upcoming x86_64-pc-cygwin
target.  Ok for apply?

Regards,
Kai

Index: src/x86/win64.S
===================================================================
--- src/x86/win64.S	(Revision 196898)
+++ src/x86/win64.S	(Arbeitskopie)
@@ -295,7 +295,7 @@
 	mov	%rax, %rcx	# context is first parameter
 	mov	%rsp, %rdx	# stack is second parameter
 	add	$48, %rdx	# point to start of arguments
-	mov	$SYMBOL_NAME(ffi_closure_win64_inner), %rax
+	leaq	SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax
 	callq	*%rax		# call the real closure function
 	add	$40, %rsp
 	movq	%rax, %xmm0	# If the closure returned a float,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch libffi]: Make sure code is position-independent for x64 targets
  2013-03-22  7:43 [patch libffi]: Make sure code is position-independent for x64 targets Kai Tietz
@ 2013-03-22  9:19 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2013-03-22  9:19 UTC (permalink / raw)
  To: Kai Tietz; +Cc: GCC Patches, libffi-discuss

On 03/22/2013 07:42 AM, Kai Tietz wrote:
> Tested for x86_64-w64-mingw32, and for upcoming x86_64-pc-cygwin
> target.  Ok for apply?

Yes, that's fine.

Andrew.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-22  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-22  7:43 [patch libffi]: Make sure code is position-independent for x64 targets Kai Tietz
2013-03-22  9:19 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).