[Openmcl-cvs-notifications] r10881 - /trunk/source/level-0/l0-cfm-support.lisp

gb at clozure.com gb at clozure.com
Fri Sep 26 09:42:46 EDT 2008


Author: gb
Date: Fri Sep 26 09:42:45 2008
New Revision: 10881

Log:
In the extremely troublesome SONAME-PTR-FROM-LINK-MAP: dynamic entries
may be in the high end of the address space, so be careful about signedness.
There were/are issues with Linux's use of the Elf*_Dyn_D_un union: sometimes
(when a vdso is involved) the DT_STRTAB is a signed displacement relative
to to the link map's l_addr value, most other times its an absolute address,
(The ELF spec that I've seen says that it should always be an absolute
address; both FreeBSD and Solaris seem to always set it to a relative
offset.)  If, when interpreted as an address, it's between the l_addr of
the map and the dynamic entry, treat it as an address, otherwise, fall
back on the older heuristic based on the apparent sign.

I don't like any of this (guessing), but this seems to allow the shared
lib init stuff to work on the 2.6.24 sytem that I have access to and
hopefully closes ticket:338.






Modified:
    trunk/source/level-0/l0-cfm-support.lisp

Modified: trunk/source/level-0/l0-cfm-support.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/level-0/l0-cfm-support.lisp (original)
+++ trunk/source/level-0/l0-cfm-support.lisp Fri Sep 26 09:42:45 2008
@@ -174,10 +174,17 @@
                                  #+(or freebsd-target solaris-target)
                                  (%inc-ptr (pref map :link_map.l_addr) dis=
p)
                                  #-(or freebsd-target solaris-target)
-                                 (%int-to-ptr =

-                                  (if (< disp 0) =

-                                    (+ disp (pref map :link_map.l_addr))
-                                    disp))))))
+                                 (let* ((udisp #+32-bit-target (pref dynam=
ic-entries
+                                                                     :<E>l=
f32_<D>yn.d_un.d_val)
+                                               #+64-bit-target (pref dynam=
ic-entries
+                                                                     :<E>l=
f64_<D>yn.d_un.d_val)))
+                                   (if (and (> udisp (pref map :link_map.l=
_addr))
+                                            (< udisp (%ptr-to-int dynamic-=
entries)))
+                                     (%int-to-ptr udisp)
+                                     (%int-to-ptr =

+                                      (if (< disp 0) =

+                                        (+ disp (pref map :link_map.l_addr=
))
+                                        disp))))))))
 	  (%setf-macptr dynamic-entries
 			(%inc-ptr dynamic-entries
                                   #+32-bit-target



More information about the Openmcl-cvs-notifications mailing list