Overriding symbol from an external library

pmarguinaud@hotmail.com (philou)
20 Jun 2003 00:19:49 -0400

          From comp.compilers

Related articles
Overriding symbol from an external library pmarguinaud@hotmail.com (2003-06-20)
| List of all articles for this month |
From: pmarguinaud@hotmail.com (philou)
Newsgroups: comp.compilers
Date: 20 Jun 2003 00:19:49 -0400
Organization: http://groups.google.com/
Keywords: linker, question
Posted-Date: 20 Jun 2003 00:19:49 EDT

Hi all,


My problem is this :


I have 2 libraries named `libxxx.a' and `libyyy.a' which contains a
subroutine whose name is `mysub'; I want to be able to switch between
those two versions of mysub at runtime, and I want that the code within
`libxxx.a' and `libyyy.a' also makes use of the same version of mysub
( that is the one I have chosen ).
Note that some linkers such as GNU ld ( ld --wrap mysub ... ) allow
users to override a subroutine while keeping a reference to the older
version, by introducing two other symbols ( __real_mysub, __wrap_mysub
). I went trough the docs of GNU ld ( GNU ld command language ), but I
have not been able to sort that out.


Can somebody help ?


Thanks,


philou


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.