From: jont AT harlequin DOT co DOT uk (Jon Thackray) Subject: Bad linker behaviour 6 Oct 1997 09:54:22 -0700 Message-ID: <199710061630.RAA08397.cygnus.gnu-win32@zaphod.long.harlequin.co.uk> References: <199710061558 DOT QAA08198 AT zaphod DOT long DOT harlequin DOT co DOT uk> To: gnu-win32 AT cygnus DOT com Jon Thackray writes: > I have to assume the following behaviour is deliberate on the part of > the linker. Can it be turned off? What's the purpose of it? It's bad > news as far as I'm concerned, as it inhibits me from providing symbols > like free from other dlls (I get a message about can't find > _imp(double, long float, ...)() which is where I started). Globally > exchanging aa for bb in the program below allows a correct no errors > link. > > .text > .global __imp__bb > _bb: jmp *__imp__bb > __imp_bb: ret > > bash$ as -o poo.o poo.s > bash$ ld -o poo.dll --dll poo.o -e _bb > poo.o(.text+0x2):fake: undefined reference to `_imp(bool, bool)' Ah well, it turns out that this is caused by C++ attempted name mangling, and only happens in the case where the symbols can't be matched (which is the case in my example above, although it wasn't meant to be). So, the end result is that for symbols which get name mangled like this, the error messages from ld are rubbish. Is there any way of getting ld to give the real error message, instead of the message after the name mangling? - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".