????1.?????
??????windows????linux????????????????
???????????????????????д??????????????????????????????????С?
????????windows??linux???????????????????????????????
?????????????linux?μ??
????2.???????
????linux?μ??????????????????????????
????????????????????????????????
???????????????????????????????????г????????????
????????????????????г????????????????????????????н?????????????????????С??
????3.??????????
???????????д??????е???????????????????????????????????????Э?顣
?????????????????????????????????????????????????????????????????????????
??????????????????????ó???????????????????????????????????ù??????????
????4.?????????β?????
??????linux?£???????????.a?????????????????
????Step 1.?????????????????.o?????.o?????????????????????
????Step 2.ar???????.o?????.a??????????
??????????????.so??????gcc??????????????????
????????:
????$ gcc -fPIC -c *.c
????$ gcc -shared -Wl??-soname?? libfoo.so.1 -o libfoo.so.1.0 *.
????5.?????????????????????????淶
??????linux?£????????????/usr/lib ?£?
??????????????????libxxxx.a??????xxxx???lib??????
??????????????????libxxxx.so.major.minor??xxxx???lib???????major?????汾???minor????汾???
????6.?????????????г?????????Щ??
????ldd???????????????г?????????????
????????# ldd /bin/lnlibc.so.6
????=> /lib/libc.so.6 (0×40021000)/lib/ld-linux.so.2
????=> /lib/ld- linux.so.2 (0×40000000)
???????????ln??????????libc???ld-linux??
????7.????г???????е??????ζ?λ????????
???????????????д????????????????????????????????????????·??
?????????????????????(dynamic linker/loader)??
????????elf????????г???????ld-linux.so*????????????????elf????? DT_RPATH??—????????LD_LIBRARY_PATH—/etc/ld.so.cache????б?—/lib/??/usr/lib????????????????????檔