name conflict resolution

Chung Ming Huang huang at frigate.cis.ohio-state.edu
Sat Jun 17 07:14:21 AEST 1989


Is there any way to solve the following problem:

	Currently, a C_based OPS5 (a production system language) is
implemented by some guys in CMU.
A useful mechanism in OPS5 is that it allows the programmer to call
some external procedures which are coded in the other high level 
languages, like C. However, there is a name conflict between OPS5 and C (or say
UNIX system calls). In OPS5, there is a system function called: bind;
in a C program, if one wants to do the inter-process communication, one 
needs to call the system routine "bind" to initialize
the socket. If:
1) in my OPS5 program, I use the "bind" (OPS5's)
in some actions; 
2) in my OPS5 program,  I need to call an external procedure which have the 
"bind" (UNIX's) command to initialize some sockets.
3) I use the OPS5 compiler to translate the OPS5 program to the object
code; I also use cc -c filename(store the external procedure coded in C) to
produce the corresponding object code.

QUESTION:

In the link phase, how to link these two different "bind"s to their
corresponding code?

I also use ld ... to do the linking individually (after the OPS5 code
has been translated into the object code), and then use
ld to link these two object codes together. The result is that
"_bind is multiple defined in ...".

So, is there any way to solve the above problem? I know the best way is
to change the name of "bind" in OPS5, however, it creates portability
problems. Therefore, the perfect way is that there are some ways to
handle the name conflict. 


C. M. Huang



More information about the Comp.unix.questions mailing list