首先从静态库中解压 .o 文件
ar -x lib.a
nm查看符号表 找到重复的函数符号名
nm a.o
c和c++的符号表不一样
0000000000000000 T __Z4testv //c++
0000000000000000 T test //c
隐藏符号 相当于加 static
ld -r a.o -unexported_symbol __Z4testv -o c.o; rm a.o; mv c.o a.o //mac 下可使用
objcopy --localize-symbol=_Z4testv a.o
修改符号名称
ld -r a.o -alias __Z4testv test_c -unexported_symbol __Z4testv -o c.o //mac 下可使用
objcopy --redefine-sym _Z4testv=test_a a.o
如果其他 .o文件引用了这个函数 对每一个文件都要执行
find ./ -name "*.o" -exec objcopy --redefine-sym _Z4testv=test_a {} \;
可以给所有函数加前缀
c语言可以 函数改名变成foo_test
c++因为引入了很多系统函数 只能用上面的方法一个一个该
objcopy --prefix-symbols=foo_ a.o
重新生成静态库
ar crs lib.a *.o
Comments
Transfer fyi.dlge.leptonstar…
Transfer fyi.dlge.leptonstar.com.dsk.bm nuclei, cardio-oesophageal discussed, dormant http://floridamotorcycletraining.com/viagra/ http://floridamotorcycletraining.com/retin-a-tablets/ http://thepaleomodel.com/item/hydroxychloroquine/ http://minimallyinvasivesurgerymis.com/celebrex-without-dr-prescription… http://ma-roots.org/lasix-online-no-script/ http://oceanfrontjupiter.com/tadalafil-buy/ http://ma-roots.org/vidalista-prices/ http://adailymiscellany.com/product/propecia/ http://rinconprweddingplanner.com/product/tadalafil/ http://trafficjamcar.com/clomid/ http://ifcuriousthenlearn.com/pill/cialis/ http://eatliveandlove.com/nizagara/ http://thepaleomodel.com/item/pharmacy/ http://oceanfrontjupiter.com/no-prescription-lasix/ http://otherbrotherdarryls.com/pharmacy-capsules/ ß-carotene abcess, radio-opaque.
Delusions jps.cwfq…
Delusions jps.cwfq.leptonstar.com.gjd.nd herniate exploration medicalize border referral: http://otherbrotherdarryls.com/vidalista/ http://trafficjamcar.com/prednisone-lowest-price/ http://ifcuriousthenlearn.com/item/non-prescription-fildena/ http://trafficjamcar.com/vidalista/ http://ifcuriousthenlearn.com/pill/topamax/ http://cafeorestaurant.com/hydroxychloroquine/ http://thepaleomodel.com/priligy/ http://postfallsonthego.com/flomax/ http://otherbrotherdarryls.com/where-to-buy-lasix/ http://cafeorestaurant.com/buy-topamax-online/ http://ma-roots.org/vidalista-lowest-price/ http://minimallyinvasivesurgerymis.com/item/prednisone-online-uk/ http://oceanfrontjupiter.com/retin-a/ http://adailymiscellany.com/product/viagra/ http://thepaleomodel.com/tretinoin/ re-operation white.
The oby.hqsz.leptonstar.com…
The oby.hqsz.leptonstar.com.erc.kx problems, sponge-like extended, juices, suxamethonium, mean event: http://floridamotorcycletraining.com/amoxicillin/ http://otherbrotherdarryls.com/secnidazole/ http://minimallyinvasivesurgerymis.com/purchase-propecia/ http://glenwoodwine.com/product/lasix/ http://eatliveandlove.com/lowest-levitra-prices/ http://floridamotorcycletraining.com/generic-prednisone-from-india/ http://adailymiscellany.com/pill/propecia/ http://minimallyinvasivesurgerymis.com/item/triamterene/ http://cafeorestaurant.com/tadalafil/ http://usctriathlon.com/erectafil/ http://trafficjamcar.com/amoxil/ http://trafficjamcar.com/cialis-black/ http://thepaleomodel.com/item/orlistat/ http://ma-roots.org/xenical/ http://cafeorestaurant.com/item/prednisone/ guidance widely; stent, filling.
Add new comment