thincal
thincal

Reputation: 63

About the armlink behavior when the linked object is not explicitly used by the main executable

I want to link the example with liba.so, even though the example is NOT using anything inside the liba.so:

    armlink --userlibpath /mylib/lib liba.so --fpic --shared 
        -o example main.o demo.o

I get nothing from readelf -d example | grep NEEDED, it seems that armlink does some optimization to remove the linked library which is referenced by the "example".

If I want the liba.so be always linked into example, what need I do with armlink options?

Any information is very appreciated ;)

Upvotes: 1

Views: 523

Answers (1)

Rigmar
Rigmar

Reputation: 11

7 years ago, well, anyway. You need --keep armlink option

--keep This option specifies input sections that must not be removed by unused section elimination.

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0804b/CHDJGJEC.html

Upvotes: 1

Related Questions