1

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

Paul Dixon
  • 295,876
  • 54
  • 310
  • 348
thincal
  • 63
  • 7
  • Here's how you'd do it with gcc, http://stackoverflow.com/questions/4767925/how-to-force-gcc-to-link-unreferenced-static-c-objects-from-a-libraray I am not familiar with armlink but it looks different, but this might give you ideas for the kinds of option to look for. – Paul Dixon Jun 29 '12 at 05:56
  • Yes, I am looking for similar "-Wl,--whole-archive -lyourlib" in armlink... but no progress so far, does any expert on armlink give some help ? many thanks. – thincal Jul 03 '12 at 04:29

1 Answers1

1

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

Rigmar
  • 11
  • 1