Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

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

Writer Emily Wong

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 ;)

2

1 Answer

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.