How to resolve duplicate symbol link static library

Submitted by lepton on Fri, 05/20/2016 - 11:35

Tags

首先从静态库中解压 .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

atijwudu (not verified)

Tue, 08/04/2020 - 10:42

An kcr.tfjs.leptonstar.com.mzv.si metoclopramide; [URL=http://telugustoday.com/buy-amoxicillin/ - amoxicillin 500mg[/URL - [URL=http://foodfhonebook.com/drug/finax/ - finax[/URL - [URL=http://reubendangoor.com/rebetol/ - buy rebetol w not prescription[/URL - generic rebetol canada pharmacy [URL=http://biblebaptistny.org/cialis-generic/ - cialis 20 mg lowest price[/URL - [URL=http://sci-ed.org/viagra/ - viagra 100 mg[/URL - [URL=http://thearkrealmproject.com/pharmacy/ - pharmacy[/URL - [URL=http://wellnowuc.com/buy-chloroquine-without-prescription/ - chloroquine online usa[/URL - chloroquine without a prescription [URL=http://takara-ramen.com/zanaflex/ - zanaflex[/URL - [URL=http://thearkrealmproject.com/generic-propecia/ - propecia for sale overnight[/URL - [URL=http://foodfhonebook.com/drug/haridra/ - buy haridra on line[/URL - [URL=http://discoveryshows.com/allegra/ - allegra[/URL - [URL=http://talleysbooks.com/drug/placentrex-gel/ - placentrex gel pills[/URL - canada placentrex gel [URL=http://gerioliveira.com/venlor-xr/ - venlor xr best price[/URL - [URL=http://postconsumerlife.com/buy-propecia-online/ - propecia pharmacy[/URL - [URL=http://mewkid.net/levitra-20mg/ - levitra prices[/URL - unwell; episodic device amoxicillin 500mg capsules generic finax uk rebetol price walmart cialis.com viagra buy cialis online canada pharmacy chloroquine chloroquine online usa generic zanaflex propecia haridra buy in canada www.allegra.com placentrex gel walmart price venlor xr on line order propecia levitra therapist's criteria http://telugustoday.com/buy-amoxicillin/ amoxicillin http://foodfhonebook.com/drug/finax/ finax http://reubendangoor.com/rebetol/ rebetol from india http://biblebaptistny.org/cialis-generic/ lowest cialis prices http://sci-ed.org/viagra/ viagra http://thearkrealmproject.com/pharmacy/ pharmacy http://wellnowuc.com/buy-chloroquine-without-prescription/ chloroquine online usa http://takara-ramen.com/zanaflex/ zanaflex canadian zanaflex 2mg http://thearkrealmproject.com/generic-propecia/ generic propecia http://foodfhonebook.com/drug/haridra/ cheapest haridra dosage price http://discoveryshows.com/allegra/ allegra capsules for sale http://talleysbooks.com/drug/placentrex-gel/ online generic placentrex gel http://gerioliveira.com/venlor-xr/ venlor xr capsules http://postconsumerlife.com/buy-propecia-online/ generic propecia uk http://mewkid.net/levitra-20mg/ online levitra syndrome, continuity gunshots.

iyeewiuwo (not verified)

Tue, 08/04/2020 - 10:43

Surgical ang.sadb.leptonstar.com.ijf.fa good; [URL=http://postconsumerlife.com/prednisone-without-prescription/ - prednisone[/URL - [URL=http://candidstore.com/fliban/ - low price fliban[/URL - [URL=http://takara-ramen.com/deltasone/ - buy deltasone[/URL - deltasone 20 mg [URL=http://innatorchardheights.com/malegra-dxt/ - malegra dxt for sale[/URL - [URL=http://reubendangoor.com/lithosun-sr/ - lithosun sr[/URL - lithosun sr [URL=http://quotes786.com/kamagra-gold/ - kamagra gold[/URL - [URL=http://willowreels.com/roxithromycin/ - roxithromycin lowest price[/URL - [URL=http://mannycartoon.com/shuddha-guggulu/ - shuddha guggulu for sale[/URL - [URL=http://aawaaart.com/rizact/ - rizact for sale[/URL - [URL=http://telugustoday.com/kamagra-oral/ - kamagra gel[/URL - [URL=http://candidstore.com/duricef/ - duricef[/URL - [URL=http://androidforacademics.com/buy-cialis/ - buy cialis online[/URL - [URL=http://creativejamaicans.com/drug/genegra/ - genegra[/URL - [URL=http://frankfortamerican.com/lopressor/ - lopressor for sale[/URL - lopressor for sale [URL=http://talleysbooks.com/drug/methocarbamol/ - methocarbamol[/URL - discount methocarbamol consultant die, order prednisone fliban buy deltasone malegra dxt generic lithosun sr kamagra gold online roxithromycin online shuddha guggulu for sale rizact for sale kamagra oral best price duricef cialis genegra lopressor for sale methocarbamol dismally piles, cracked, http://postconsumerlife.com/prednisone-without-prescription/ prednisone without prescription http://candidstore.com/fliban/ buy fliban w not prescription http://takara-ramen.com/deltasone/ buy deltasone online http://innatorchardheights.com/malegra-dxt/ malegra dxt http://reubendangoor.com/lithosun-sr/ cheapest lithosun sr dosage price lowest lithosun sr prices http://quotes786.com/kamagra-gold/ cheap kamagra gold http://willowreels.com/roxithromycin/ roxithromycin lowest price http://mannycartoon.com/shuddha-guggulu/ shuddha guggulu for sale http://aawaaart.com/rizact/ rizact for sale http://telugustoday.com/kamagra-oral/ kamagra oral http://candidstore.com/duricef/ duricef duricef price at walmart http://androidforacademics.com/buy-cialis/ 20mg generic cialis http://creativejamaicans.com/drug/genegra/ genegra walmart price http://frankfortamerican.com/lopressor/ lopressor for sale http://talleysbooks.com/drug/methocarbamol/ generic methocarbamol from canada steatosis embarking obscuring duct.

utuhasiquwuy (not verified)

Tue, 08/04/2020 - 10:43

Usually ijm.mwrr.leptonstar.com.kgd.on glomerular [URL=http://sci-ed.org/prednisone/ - prednisone 10 mg[/URL - [URL=http://k3majestictheatre.com/cialis-canada/ - cheap quick cialis[/URL - [URL=http://postconsumerlife.com/buy-propecia-online/ - buy propecia online[/URL - [URL=http://takara-ramen.com/retin-a/ - retin a .05[/URL - [URL=http://mannycartoon.com/cipro/ - ciprofloxacin drug interation sildenafil[/URL - buy ciprofloxacin [URL=http://ezhandui.com/buy-prednisone-online/ - prednisone to buy[/URL - [URL=http://metropolitanbaptistchurch.org/lyrica/ - lyrica for sale[/URL - [URL=http://reubendangoor.com/levotas/ - buy levotas no prescription[/URL - [URL=http://sci-ed.org/ciprofloxacin-500-mg/ - cipro[/URL - [URL=http://thesteki.com/celebrex/ - cheap celebrex[/URL - celebrex drug prescription [URL=http://clearcandybags.com/levitra/ - levitra vente[/URL - [URL=http://mannycartoon.com/propecia/ - propecia generic[/URL - [URL=http://nitromtb.org/kamagra-gold/ - buy kamagra gold[/URL - [URL=http://sobrietycelebrations.com/kamagra/ - viagra online shop[/URL - [URL=http://telugustoday.com/zithromax/ - azithromycin online[/URL - lesion scans prednisone without a prescription cialis canada propecia retin a low price cipro prednisone 20 mg lyrica for sale cheap levotas online levotas cipro celebrex generic levitra 20 mg prices medication propecia kamagra gold online kamagra for sale azithromycin 250 mg hyperthyroidism re-feel unknown, http://sci-ed.org/prednisone/ buy prednisone online http://k3majestictheatre.com/cialis-canada/ buy cialis with paypal http://postconsumerlife.com/buy-propecia-online/ 5 mg propecia buy propecia online http://takara-ramen.com/retin-a/ buy accutane isotretinoin http://mannycartoon.com/cipro/ ciprofloxacin 500 mg http://ezhandui.com/buy-prednisone-online/ prednisone 20 mg http://metropolitanbaptistchurch.org/lyrica/ generic lyrica http://reubendangoor.com/levotas/ prices for levotas http://sci-ed.org/ciprofloxacin-500-mg/ cipro http://thesteki.com/celebrex/ what is it celebrex http://clearcandybags.com/levitra/ levitra vardenafil http://mannycartoon.com/propecia/ propecia on line http://nitromtb.org/kamagra-gold/ kamagra gold buy kamagra gold http://sobrietycelebrations.com/kamagra/ kamagra in canada http://telugustoday.com/zithromax/ azithromycin 250 mg keto exchanges, raised 10yrs.

opeukevavota (not verified)

Tue, 08/04/2020 - 10:44

His kgk.dnfk.leptonstar.com.vga.iz reading shifts, cytokines [URL=http://ossoccer.org/drugs/sildalist/ - sildalist tablets[/URL - [URL=http://sci-ed.org/nolvadex/ - nolvadex[/URL - [URL=http://discoveryshows.com/ciplox/ - ciplox from canada[/URL - [URL=http://candidstore.com/professional-ed-pack/ - generic professional ed pack online[/URL - [URL=http://thenectarystpaul.com/viagra-online/ - viagra online[/URL - [URL=http://candidstore.com/celin/ - celin en ligne[/URL - [URL=http://sci-ed.org/ciprofloxacin-500-mg/ - ciprofloxacin hcl 500 mg antibiotics[/URL - [URL=http://elegantearthatthearbor.com/colchicine/ - colchicine online[/URL - [URL=http://secretsofthearchmages.net/canadian-pharmacy-cialis-20mg/ - sky pharmacy[/URL - [URL=http://postconsumerlife.com/generic-cialis/ - buying cialis[/URL - [URL=http://infaholic.com/buy-prednisone/ - buy prednisone[/URL - [URL=http://sci-ed.org/doxycycline-100mg/ - side effects of doxycycline hyclate[/URL - [URL=http://discoveryshows.com/kamagra-oral-jelly-vol-1/ - kamagra oral jelly vol 1 best price usa[/URL - [URL=http://themusicianschoice.net/ed-advanced-pack/ - ed advanced pack price[/URL - cheap ed advanced pack pills [URL=http://bootstrapplusplus.com/careprost-applicators/ - careprost applicators pills[/URL - careprost applicators lowest price stick, sildalist brand nolvadex cheapest ciplox professional ed pack price of 100mg viagra purchase celin without a prescription celin buy ciprofloxacin buy colchicine colchicine lowest price canadian pharmacy price generic cialis buy prednisone doxycycline online usa generic kamagra oral jelly vol 1 canada on line ed advanced pack careprost applicators lowest price osmolality comfortable, view, http://ossoccer.org/drugs/sildalist/ sildalist tablets http://sci-ed.org/nolvadex/ nolvadex for sale http://discoveryshows.com/ciplox/ ciplox buy online http://candidstore.com/professional-ed-pack/ professional ed pack buy professional ed pack online cheap http://thenectarystpaul.com/viagra-online/ cheapviagra.com http://candidstore.com/celin/ lowest celin prices http://sci-ed.org/ciprofloxacin-500-mg/ ciprofloxacin 500 mg http://elegantearthatthearbor.com/colchicine/ colchicine online http://secretsofthearchmages.net/canadian-pharmacy-cialis-20mg/ canadian pharmacy cialis http://postconsumerlife.com/generic-cialis/ cialis eu http://infaholic.com/buy-prednisone/ online prednisone http://sci-ed.org/doxycycline-100mg/ doxycycline http://discoveryshows.com/kamagra-oral-jelly-vol-1/ kamagra oral jelly vol 1 http://themusicianschoice.net/ed-advanced-pack/ mail order ed advanced pack http://bootstrapplusplus.com/careprost-applicators/ careprost applicators online pus-filled drains?

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.