link issues



This is not a Fortran language question per se. But I do not know where
else to ask, so please accept my apologies, and perhaps help me out by
giving pointers to relevant discussion groups.

I have a static library composed of several objects. I do not have the
source codes, just the compiled binary of the static link library and
declarations of the routines. I frequently use the routines supplied by
this library, but I need to redefine one of the subroutines. If I
simply go ahead and try to link in the new definition, I get, as may be
expected, link time error for doubly defined symbols.

The compiled binary (on some platform) looks like this (using the GNU
nm):

$ nm foo.lib
<snip>
file1.obj:
00000000 b .bss
00000000 d .data
00000000 N .debug$F
00000000 i .drectve
00000000 t .text
00000004 T _DSPSD
00000004 T _DSPSD@16
00000001 T _DSPXSQ
00000001 T _DSPXSQ@24
<snip>
file2.obj:
00000000 b .bss
00000000 d .data
00000000 N .debug$F
00000000 i .drectve
00000000 t .text
00013a52 T _FOOBAR -> I want to use my own subroutine FOOBAR
00013a52 T _FOOBAR@96
00014f6d T _UNIT
00014f6d T _UNIT@32
000166d5 T _MOME
000166d5 T _MOME@80
<snip>

It is definately possible to unpack the library and replace the objects
with newly compiled ones (infact, it is almost trivial with GNU ar).
But is it possible to replace a single routine in a given object?

Most probably solutions for these type of issues are platform specific.
Nevertheless, any comments, be it general or specific to the platform
that you are possibly comfortable with, will be extremely helpful.

thank you!
- s.l.yi

.



Relevant Pages

  • Re: French Gov handing out Linux in schools
    ... <snip examples; Sendmail has been patched any number of times - just like ... about my own preferred development platform... ... Cite! ... >> dedicated techies) have missed the holes in OpenSSL and the Linux ...
    (alt.computer.security)
  • Re: Aqua is a Plastic Cube!
    ... if WPF were put into Apple's old Mac OS X ... the problem this platform has is that it's rather vaguely defined, ... Cairo has an X-compatibility layer, but it does not require X, ...
    (comp.sys.mac.advocacy)
  • Re: Wild speculations about the "other" factors
    ... <SNIP> ... because that's what most>> Windows programmers do. ... No. Cross platform C++ is very much alive. ... How about using the new IDE as a platform that can host many different ...
    (borland.public.delphi.non-technical)
  • Re: What is it? Set 230
    ... since that would change from platform to platform. ... "Bookmark link..."= Add link to bookmarks ... I've been avoiding Linux because I ...
    (rec.crafts.metalworking)
  • Re: <ctype.h> toLower()
    ... How tolower is implemented is unimportant. ... ANY conceivable system that has a standard-conforming C compiler, ... There'd be little point in having a platform independent language ...
    (alt.comp.lang.learn.c-cpp)