cmp: search for tag only when name is unique
authorDaniel Kochmański <daniel@turtleware.eu>
Fri, 31 Jul 2015 07:29:41 +0000 (09:29 +0200)
committerDaniel Kochmański <daniel@turtleware.eu>
Fri, 31 Jul 2015 07:29:56 +0000 (09:29 +0200)
fasl and program init function names are always the same, don't search
for tag in binary files for this two targets.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
src/cmp/cmpname.lsp

index e11e779..5d324f7 100644 (file)
@@ -101,9 +101,12 @@ the function name it precedes."
         name))))
 
 (defun guess-init-name (pathname kind)
-  (or (and (probe-file pathname)
-           (find-init-name pathname :tag (kind->tag kind)))
-      (error "Cannot find out entry point for binary file ~A" pathname)))
+  (case kind
+    ((:object :c :static-library :lib :shared-library :dll)
+     (or (and (probe-file pathname)
+              (find-init-name pathname :tag (kind->tag kind)))
+         (error "Cannot find out entry point for binary file ~A" pathname)))
+    (otherwise (compute-init-name pathname kind))))
 
 (defun remove-prefix (prefix name)
   (if (equal 0 (search prefix name))