openap-cvs
[Top][All Lists]
Advanced

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

[openap-cvs] : openap-main/scripts mklibs,1.5,1.6


From: David Kimdon <address@hidden>
Subject: [openap-cvs] : openap-main/scripts mklibs,1.5,1.6
Date: Thu, 08 Aug 2002 13:08:41 -0400

Update of /cvsroot/openap/openap-main/scripts
In directory subversions:/tmp/cvs-serv16417

Modified Files:
        mklibs 
Log Message:
find dynamic linker from elf header rather than trying to guess it based on the
libc version.


Index: mklibs
===================================================================
RCS file: /cvsroot/openap/openap-main/scripts/mklibs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- mklibs      6 Aug 2002 01:21:02 -0000       1.5
+++ mklibs      8 Aug 2002 17:08:38 -0000       1.6
@@ -275,6 +275,22 @@
     else:
         objects[inode] = prog
 
+if ldlib == None:
+    pattern = re.compile(".*Requesting program interpreter:.*/([^\]/]+).*")
+    for obj in objects.values():
+        output = command(target + "readelf", "--program-headers", obj)
+       for x in output:
+           match = pattern.match(x)
+           if match:
+               ldlib = match.group(1)
+                debug(DEBUG_NORMAL, "I: Using", ldlib, "as dynamic linker.")
+               break
+       if ldlib:
+           break
+
+if ldlib == None:
+    sys.exit("E: Dynamic linker not found, aborting.")
+
 passnr = 1
 while 1:
     debug(DEBUG_NORMAL, "I: library reduction pass", `passnr`)
@@ -389,8 +405,6 @@
             base_name = so_pattern.match(library).group(1)
             # libc needs its soinit.o and sofini.o as well as the pic
             if base_name == "libc":
-                if not ldlib:
-                    ldlib = "ld-" + re.match("libc-(.*).so", 
so_file_name).group(1) + ".so"
                 extra_flags = find_lib(ldlib)
                 extra_pre_obj = "" #libc_extras_dir + "/soinit.o"
                 extra_post_obj = "" #libc_extras_dir + "/sofini.o"




reply via email to

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