Hello everyone,

I'm trying to link a shared library against a shared library,
using gcc/ld on Linux and with code like this:

//////////////////////////////////////////////////////

//
// test.c (shared library sourcecode)
//

extern int unknown_function(int value);

int testfunc(void)
{
  return(unknown_function(0x77));
}

//////////////////////////////////////////////////////

Compiling the sourcecode above like this:

  gcc test.c -o test.so -shared -fPIC [-s]

The problem is that i'd expect gcc/ld to abort with an error,
but it just 'successfully' links something.

Am i missing something? How can ld link against a
definitely unknown function?

Tested on Debian-64 (amd64), using:

  gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Same problem on KNOPPIX 3 (x86-32), using:

  gcc (GCC) 3.3.5 (Debian 1:3.3.5-3)

--

Cheers,

Oliver 'Bloody' Lange.

Reply via email to