heres what ive done in the past... havent don this on the newer openldap libs on aix...
create export file:
nm -B <static lib>|sed -n -e 's/^.*[ ]\([BCDT]\)[ ][ ]*\(\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p' | sed 's/.* //' | sort | uniq > <output exp file name>.exp
example...
nm -B liblber.a|sed -n -e 's/^.*[ ]\([BCDT]\)[ ][ ]*\(\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p' | sed 's/.* //' | sort | uniq > ../liblber.exp
ar -x <static lib>
create library:
cc -bM:SRE -o <out> *.o -L<library search path> -lc <other libs> -bE:../<exp file name>.exp -bnoentry -bnoquiet
example...
cc -bM:SRE -o libldap.a *.o -L/usr/local/lib -lc -llber -lssl -lcrypto -bE:../libldap.exp -bnoentry -bnoquiet
the formating of the spaces matters!! i also used the ibm c compiler, and this was done for 32 bit builds...
i think ive used ibm's ld for this as well (creating the lib), its been a while...
please note that i used this on aix 4.3.3 and 5.1. havent tried this on 5.2, so things may have changed enough that this wont produce anything useful.