replacing an exported symbol in a standard static library

replacing an exported symbol in a standard static library

Post by Mani » Fri, 23 Aug 2002 17:21:05



How Do I replace an exported symbol in a static library with my own.

Thanks & Regards
Manish

 
 
 

replacing an exported symbol in a standard static library

Post by Gary R. Hoo » Sat, 24 Aug 2002 00:03:09



> How Do I replace an exported symbol in a static library with my own.

If it's a static archive, just replace the object file in the
archive with your new one (ar -rv <archive>).

If you're talking about a loadable/shared module within an archive,
first look at http://www.ibm.com/servers/esdd/pdfs/aix_ll.pdf, page
12.  The axtract the module from the archive and ensure it's a
loadable module (dump -Hv <file> should produce loader information).
If you don't have the original files used to create the module
(Makefile, etc) then I would suggest using "rtl_enable -s <file>"
to generate the import/export list and command script for rebuilding
the module.

Edit the command script to remove the runtime linking options (which
are "-brtl -bnortllib -bnosymbolic -bnoautoexp" if they're not
required).  Stick in your new object file _first_ on the command
line.  Run the shell script and you'll have a new module with replaced
definitions.

Rename foo.new and re-archive the module and you're good to go.

If this isn't what you were really looking for, post more details about
the problem.

--
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
________________________________________________________________________

 
 
 

1. Problems linking static library on executable and static library

Hi,
  I'm a newbie in programming on Un*x platforms, so maybe, it could
be caused by my lack of experience.

Ok. I have a static library "libSM.a" depending on two libraries one
of them shared: "libErrP.so" and a static one: "libCB.a"

I'm trying to compile an executable "EInvA" linking with both "libSM.a" and
"libCB.a" and get the following error:

CC  -mt -fast -DNONE_CLASH -o RELEASE/EInvA     RELEASE/inva.o
-lsocket -lnsl -ldl -lCstd -lc -lnsl -lsocket -lclntsh
-L/libs/libSM/STATIC -lSM -L/libs/libCB/STATIC -lCB

Undefined symbol                 first referenced in file

int CB::Connect(char*, char*) /libs/libSM/STATIC/libSM.a (libSM.o)
CB::CB()                      /libs/libSM/STATIC/libSM.a (libSM.o)
CB::~CB()                     /libs/libSM/STATIC/libSM.a (libSM.o)

And "CB" symbols are defined in "libCB.a"

?Could someone tell me what could be happening?

Thanks in advanced,
   R.

2. Setting up identd

3. Limiting exported symbols from a shared library

4. User Friendly

5. Exporting symbols in a dynamic library

6. 2.2.8 Install on Laptop

7. How to export specific symbols from shared libraries?

8. setting up web server with Linux- requirements??

9. Shared libraries/ Resolving Sybmbols on AIX/Exporting symbols

10. Shared Library exported symbols

11. exporting symbols from shared library

12. how to strip/hide a global symbol in a static library