delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/25/01:33:19

From: W DOT Derks AT nl DOT cis DOT philips DOT com ("wiljan")
Subject: Re: Apparent DLL loader problems. --> Rusian roulette with ld
25 Jan 1997 01:33:19 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199701250834.JAA13570.cygnus.gnu-win32@nl.cis.philips.com>
Mime-Version: 1.0
Original-To: <mike AT sni DOT ca>, <report AT gnat DOT com>, <gnu-win32 AT cygnus DOT com>
Original-Cc: "Pacal Orby" <Pascal DOT Obry AT der DOT edfgdf DOT fr>
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Mike wrote:

>         From the debugger output, it looks like the indirection table
> used by some of the system calls (e.g. lstat, setjmp) are not being
> properly initialized when cygwin.dll is loaded.  They seem to be retaining
> data  that they had on program start (probably the relative address of the
> routines inside the dlls, but I don't know).
>  
>         The exact point at which the program dies changes, depending on the
> order of linkage of the exact same modules.  For example, if you link with
> one order, setjmp fails by jumping out to an invalid address, relink in a
> different order and lstat does the same thing.

I have exactly the same problem.
I have a call to getsystemtime in my executable. When checking
the linkmap, ld takes the right things from libkernel32.a
But when the image is loaded the call to getsystemtime does not
work because the indirect jump to it is WRONG. I checked this with gdb.
I have checked my executables with
   dumpbin/imports
For a bad executable the routine getsystemtime is simply missing from
this import list and I am 100% sure that I use it.
This will cause the program to be loaded incorrectly.

Besides this I have also seen that linking order can make a big difference
in the size of the .text section of the executable. Sometimes it is
simple 3 times a big (instead about 8000 18000 hex).
This also indicates that ld does something wrong when generating the .exe

It only seems to happen with larger programs.
In general it means that one can not trust images generated by ld.
The errors can apear at any state of a project, by simply adding some code.

Who can help me with this problem ??

I am using 17.1

Wiljan Derks

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019