The attached script takes the name of a .exe or .dll, uses cygcheck to find the dll dependence and checks for conflicts.
This will allow you to check your favorite applications or dlls, seeing if --enable-auto-image-base works for you. Here is an example output: ~: check_bases /usr/sbin/sshd.exe C:/progra~1/cygwin/usr/sbin/sshd.exe 00400000 0004b000 C:\progra~1\cygwin\bin\cygcrypt-0.dll 10000000 00007000 C:\progra~1\cygwin\bin\cygz.dll 10000000 00015000 CONFLICT End: 268464128 Start:268435456 C:\progra~1\cygwin\bin\cygwin1.dll 61000000 00259000 C:\progra~1\cygwin\bin\cygcrypto-0.9.8.dll 63000000 0010a000 C:\WINDOWS\system32\ADVAPI32.DLL 77dd0000 0009b000 C:\WINDOWS\system32\RPCRT4.dll 77e70000 00091000 GUARD CONFLICT End: 2011607040 Start:2011627520 C:\WINDOWS\system32\KERNEL32.dll 7c800000 000f4000 C:\WINDOWS\system32\ntdll.dll 7c900000 000b0000 GUARD CONFLICT End: 2089762816 Start:2089811968 A "conflict" is when the end of a dll overlaps the start of the next one. A "guard conflict" includes the extra 0x10000 mentioned by Jason in this thread. They occur with Windows dlls, not sure if that's a real issue. Here is a more complex one: ~: check_bases /bin/exim-4.52-1.exe C:/progra~1/cygwin/bin/exim-4.52-1.exe 00400000 000c2000 C:/progra~1/cygwin/bin\cygcrypto-0.9.7.dll 0fe00000 000dd000 C:/progra~1/cygwin/bin\cygcrypt-0.dll 10000000 00007000 C:/progra~1/cygwin/bin\cyggdbm-4.dll 10000000 0000d000 CONFLICT End: 268464128 Start:268435456 C:/progra~1/cygwin/bin\cyglber-2-2-7.dll 10000000 0000f000 CONFLICT End: 268488704 Start:268435456 C:/progra~1/cygwin/bin\cygsasl2-2.dll 10000000 00018000 CONFLICT End: 268496896 Start:268435456 C:/progra~1/cygwin/bin\cygssl-0.9.7.dll 10000000 0002f000 CONFLICT End: 268533760 Start:268435456 C:/progra~1/cygwin/bin\cygldap-2-2-7.dll 10000000 00031000 CONFLICT End: 268627968 Start:268435456 C:/progra~1/cygwin/bin\cygssl-0.9.8.dll 10000000 00039000 CONFLICT End: 268636160 Start:268435456 C:/progra~1/cygwin/bin\cygiconv-2.dll 10000000 000f2000 CONFLICT End: 268668928 Start:268435456 C:/progra~1/cygwin/bin\cygwin1.dll 61000000 00259000 C:/progra~1/cygwin/bin\cygcrypto-0.9.8.dll 63000000 0010a000 C:/progra~1/cygwin/bin\cygminires.dll 6dcc0000 0000b000 C:\WINDOWS\system32\ADVAPI32.DLL 77dd0000 0009b000 C:\WINDOWS\system32\RPCRT4.dll 77e70000 00091000 GUARD CONFLICT End: 2011607040 Start:2011627520 C:\WINDOWS\system32\KERNEL32.dll 7c800000 000f4000 C:\WINDOWS\system32\ntdll.dll 7c900000 000b0000 GUARD CONFLICT End: 2089762816 Start:2089811968 Pierre
#! /bin/bash final_dec=0 final_guard_dec=0 guard=0x10000 #set -x cygcheck "$1" | while read -r file do objdump -p "$file" | sed -n -e '2 {s/^/ /; s/: .*$//; h}' -e '/ImageBase/ {s/ImageBase/ /; G; h}' -e '/SizeOfImage/ {s/SizeOfImage//; G; s/[\t\n]//gp; Q}' done | sort -k 2 | while read -r size base name do conflict="" base_dec=$(( 0x$base )) if [ "$final_dec" -ge "$base_dec" ] then conflict="CONFLICT End: $final_dec Start:$base_dec" else [ "$final_guard_dec" -ge "$base_dec" ] && conflict="GUARD CONFLICT End: $final_dec Start:$base_dec" fi echo $name $base $size $conflict final_dec=$(( 0x$base + 0x$size )) final_guard_dec=$(( $final_dec + $guard )) done