libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] Multi-platform unwinding i386 binary on x86_64


From: Nurdin Premji
Subject: Re: [Libunwind-devel] Multi-platform unwinding i386 binary on x86_64
Date: Tue, 01 May 2007 15:04:25 -0400
User-agent: Thunderbird 1.5.0.10 (X11/20070302)

Nurdin Premji wrote:
Can this be committed?
This forces the memory mapped in from the inferior process to be mapped only into the first 32 bits of memory. This avoids the situation of truncated memory addresses when unwinding a 32 bit process on a 64 bit host.
--- libunwind-0.99-alpha/src/elfxx.h    2006-07-26 23:13:14.000000000 -0400
+++ mainworkspace/frysk/frysk-imports/libunwind/src/elfxx.h     2007-04-24 
16:42:55.000000000 -0400
@@ -1,6 +1,7 @@
 /* libunwind - a platform-independent unwind library
    Copyright (C) 2003, 2005 Hewlett-Packard Co
        Contributed by David Mosberger-Tang <address@hidden>
+   Copyright Red Hat 2007
 
 This file is part of libunwind.
 
@@ -42,6 +43,10 @@
 # define elf_w(x)      _Uelf64_##x
 #endif
 
+#ifndef MAP_32BIT
+# define MAP_32BIT 0
+#endif
+
 static inline int
 elf_map_image (struct elf_image *ei, const char *path)
 {
@@ -59,7 +64,7 @@
     }
 
   ei->size = stat.st_size;
-  ei->image = mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0);
+  ei->image = mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE | MAP_32BIT, fd, 0);
   close (fd);
   if (ei->image == MAP_FAILED)
     return -1;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]