Re: Unresolved symbol __multi3

Joubert Berger <[email protected]> Wed, 14 Aug 2002 13:37:17 -0400
Newsgroups gmane.linux.redhat.ia64.general
Message-ID <[email protected]>
Jim and Timothy,

Thanks.  And I can see the __multi3 in 
/usr/lib/gcc-lib/ia64-redhat-linux/2.96/libgcc.a.  What could I be doing 
that might prevent me from picking up this library?

--joubert

Jim Wilson wrote:

>>depmod: *** Unresolved symbols in /lib/modules/2.4.9-34/misc/lns.o
>>depmod:     __multi3
>>    
>>
>
>That is a libgcc routine to perform 128-bit integer multiply.
>
>Since there is no 128-bit integer type, this is usually an artifact of gcc
>internals.  Gcc represents object sizes internally in bits, so that we can
>handle bit-fields, bit-vectors, and other bit oriented types.  Unfortunately,
>this means we need 67-bit values to span the entire address space, so we hold
>them as 128-bit values.  If we need to multiply an object size, that means
>we need a 128-bit multiply.  One way this can happen in user code is when you
>dynamically allocate a variable length array.  This testcase for instance:
>struct foo { int i; };
>void sub (int i) { struct foo bar[i]; sub2 (&bar); }
>If I compile this without optimization, I get a call to __multi3.  This
>is becuse we need to multiply 'i' by sizeof (struct foo) at runtime, and
>sizeof struct foo is represented internally to gcc as a 128-bit value.  If
>I compile with optimization, the __multi3 call is optimized away.  The multi3
>call is of course unecessary, even when not optimizing, and this problem is
>already fixed in gcc-3.1.  If I compile this example with gcc-3.1 without
>optimization, I do not get a multi3 call.
>
>Jim
>
>
>  
>