Re: PROBLEM: I386ld: Symbol memmove multiply defined

From: Bela Lubkin (belal_at_sco.com)
Date: 02/03/05

  • Next message: Bela Lubkin: "Re: Microlite RecoverEdge on IBM xSeries 345, floppy"
    Date: 3 Feb 2005 05:32:12 -0500
    
    

    r_bailey@hotmail.com wrote:

    > I am trying to get the 'C' programs compiled to work with Oracle 6.
    > Before I applied the Maintenance pack, I was successful in getting the
    > programs to compile. Can anyone shed some light as to how I might fix
    > this? Besides removing the Maintenance Pack?

    > I recently applied SCO Openserver Release 5.0.7 Maintenance Pack 1. I
    > currently have the SCO OpenServer Development System Version 5.2.0Aa
    > installed. When I try to compile any programs, I will get the
    > following error message:
    >
    > I386ld: Symbol memmove in /usr/ccs/lib/libc.a is multiply defined.
    > First defined in /usr2/oracle/rdbms/lib/libora.a

    When processing an archive library (.a), the linker only pulls in
    objects which define at least one symbol it's looking for. By the time
    it's processing /usr/ccs/lib/libc.a, we know it isn't looking for
    memmove() any more, since that was defined by libora.a. So it must be
    pulling it in for some other symbol.

    In the OSR507 libc.a's I'm able to find, memmove() is defined in
    memmove.o. The same object also defines bcopy() and _bcopy().

    The implication is this: something in the binary you're trying to build
    calls bcopy() or _bcopy(). Before you installed OSR507MP1, some other
    object or library on the link line was providing that symbol before
    libc.a:memmove.o was processed; therefore, memmove.o wasn't needed, and
    its conflicting memmove() symbol wasn't pulled in.

    You could do a lot of work to track down exactly what changed. Or you
    could just correct the problem without tracking it down. A simple
    correction is to provide your own bcopy() and _bcopy():

      #include <string.h>
      #include <strings.h>
      
      void _bcopy(const void *b1, void *b2, size_t length)
      {
        memmove(b2, b1, length);
      }
      
      #pragma weak bcopy = _bcopy

    Compile this as, say, bcopy.o. Then include bcopy.o on your link line.

    >Bela<


  • Next message: Bela Lubkin: "Re: Microlite RecoverEdge on IBM xSeries 345, floppy"