Corinna Vinschen wrote: >> I haven't rebased again, but is there any reason to suspect that >> cygmagic-1.dll is not rebaseable? > > Apparently. I rebased the DLL alone and afterwards file simply stopped > working. The DLL has a base address of 0x6a500000. Even rebasing to > the very same address results in a coredump! > > The DLL has been built with -static-libgcc. Assuming that this might > have been the reason I rebuilt the file package without -static-libgcc, > so the DLL now depends on cyggcc_s.dll. And, guess what, afterwards > the DLL is rebaseable just fine. > > Dave? Any idea why this occurs?
Nope, I can't reproduce it yet. I installed the file-5.00-1 sources and then ran r...@host /usr/src/file-5.00-1 $ ./configure --prefix=/usr/local CC='gcc-4 -static-libgcc' $ make $ cd src/.libs/ $ cp cygmagic-1.dll cygmagic-1.dll.bak $ rebase -v -b 0x6a500000 ./cygmagic-1.dll r...@host /usr/src/file-5.00-1/src/.libs $ ./file.exe ./file.exe file: could not find any magic files! No crash. Then I tried it on the live version in /bin: r...@host /bin $ cp cygmagic-1.dll cygmagic-1.dll.bak r...@host /bin $ ./file.exe ./file.exe ./file.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit r...@host /bin $ rebase -v -b 0x6a500000 ./cygmagic-1.dll ./cygmagic-1.dll: new base = 6a500000, new size = 20000 r...@host /bin $ ./file.exe ./file.exe ./file.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit I verified that I have the statically linked version installed, rather than the update you just uploaded: r...@host /bin $ cygcheck ./cygmagic-1.dll F:\cygwin-1.7\bin\cygmagic-1.dll F:\cygwin-1.7\bin\cygwin1.dll C:\WINNT\system32\ADVAPI32.DLL C:\WINNT\system32\NTDLL.DLL C:\WINNT\system32\KERNEL32.DLL C:\WINNT\system32\RPCRT4.DLL F:\cygwin-1.7\bin\cygz.dll r...@host /bin Did I do something wrong? Did you do something differently? I note that after my attempt to rebase at the same address, the DLL afterward is identical to the one before: dkad...@ubik /bin $ md5sum cygmagic-1.dll cygmagic-1.dll.bak 1628930e970b95891bd5ce79bab9f814 *cygmagic-1.dll 1628930e970b95891bd5ce79bab9f814 *cygmagic-1.dll.bak Do you see the same result? Because if so, that would be *really* strange! > The crash happens when the Cygwin DLL > is running the ctors list. Given that the file package is using plain > C, it seems that a static libgcc is non-relocatable for whatever reason. I'm fairly certain it shouldn't be. You can't expect exceptions to work right in these circumstances, but I wouldn't see why they would be involved. Can one of you and Chuck run addr2line on the stackdump from the crash? I have no idea what's even going on yet. cheers, DaveK -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/