ITEM: E9067L

Troubles with program linking.




Question:

I have written a program which is working great except for what I
think moght be a major bug in AIX.  I am using variables that have the
same names as other entries in a library module, but I have the
program linked to a separate module.  However, when I try to run the
program, the linker pulls character strings associated with the "same
name" variable, throws them in my program, and it crashes.  If I
remove the library module, everything works fine.  I ran the option to
get the lode map, and it continuously complained about a duplicate
symbol being replaced by the same symbol.  Can I have someone call me
back who is well versed in linking and programming.

Response:

Talked to the customer. He is faxing the output of his load map.
I will look at it and try to figure out what is going on.

Response:

Reviewed FAX information.

Called NILM, and will try again on 11/18.

Response:

Customer had two definitions of a data structure, both global, but
only one was initialized.  The init. version was in an archive, and
was being selected by the linker, in preference to the one in an
explicitly named object.  The linker will always select initialized
data structures over non-init, structures, no matter where the
definition comes from.

I suggested that the programmer use the "static" keyword to make the
data structure local to the file of interest; this sidestepped the ld
behavior, and was appropriate for the customer's application.


Support Line: Troubles with program linking. ITEM: E9067L
Dated: March 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:52
Comments or suggestions? Contact us