Index: winsup/cygwin/speclib =================================================================== RCS file: /cvs/src/src/winsup/cygwin/speclib,v retrieving revision 1.18 diff -p -u -r1.18 speclib --- winsup/cygwin/speclib 10 Apr 2009 04:29:25 -0000 1.18 +++ winsup/cygwin/speclib 12 Apr 2009 17:24:30 -0000 @@ -43,6 +43,9 @@ close $nm_fd; %extract or die "$0: couldn't find symbols for $lib\n"; +# Force the import lib head and tail in. +$extract{"d000000.o"} = 1; + my $dir = tempdir(CLEANUP => 1); chdir $dir; @@ -50,4 +53,12 @@ chdir $dir; my $res = system $ar, 'x', $libdll, sort keys %extract; die "$0: $ar extraction exited with non-zero status\n" if $res; unlink $lib; -exec $ar, 'crus', $lib, sort keys %extract; +system $ar, 'crus', $lib, sort keys %extract; + +# Post-munge it to rename import table head/name syms, making +# it a completely separate import lib from the input source lib. +my $prefix=$lib; +$prefix =~ s/.*(lib.*)\.a/\1/ ; +exec "objcopy", $lib, $lib, + "--redefine-sym", "__head_cygwin1_dll=__" . $prefix . "__head_cygwin1_dll", + "--redefine-sym", "_cygwin1_dll_iname=__" . $prefix . "_cygwin1_dll_iname";