跳转到目录 点这里
pacman -Fl objdump
pacman -Fy objdump
pacman -Ql objdump
yay -S objdump
yaourt -S objdump
sudo pacman objdump
objdump -x xxx.so | grep NEEDED
objdump -x gdb | grep NEEDED
根据 objdump 命令查找本地可执行文件依赖库,复制到其它目录
[hun-hh data]# cat bin.list /usr/bin/gdb /usr/bin/gdbserver /usr/bin/make /usr/bin/gcc --------------- [hun-hh data]# cat find_so.sh findobjdump_tree() { rm -rf so.list rm -rf so.over cat $1 > so.list while (($((`cat so.list | wc -l`))!=0)) do cat so.list |sort -k 2n|uniq |while read so do objdump -x $so | grep NEEDED |awk '{print $2}'|xargs -i grep {} so.txt >>so.list echo $so |sed 's/^.*[/]//g'|xargs -i sed -i "/{}/d" so.list echo $so >> so.over done done rm -rf so.list cat so.over rm -rf mk_alldir rm -rf cp_allfile cat so.over |xargs -i echo mkdir -p /kernel-debug/data/mylib{} |sed 's/[/][^/]*$//g' >> mk_alldir cat so.over |xargs -i echo cp -daf {} /kernel-debug/data/mylib{} |sed 's/[/][^/]*$//g' >> cp_allfile cat mk_alldir|sort -k 2n|uniq | sh cat cp_allfile|sort -k 2n|uniq | sh rm -rf mk_alldir rm -rf cp_allfile rm -rf so.over } findobjdump_tree $1 ------ [hun-hh data]# cat install.sh rm -rf ./mylib alias cp='cp' find /lib/* /lib64/* /usr/* > /kernel-debug/data/so.txt find /lib/* /lib64/* /usr/* -type d > all_lib cat bin.list | sed 's/^.*///g'|xargs -i grep {} all_lib > other_dir sh find_so.sh bin.list rm -rf cat mk_other_dir rm -rf cat cp_other_dir cat other_dir |xargs -i echo mkdir -p /kernel-debug/data/mylib{} |sed 's/[/][][/][^/]*$//g' >> mk_other_dir cat other_dir |xargs -i echo cp -daf {} /kernel-debug/data/mylib{} |sed 's/[/][^/]*$//g' >> cp_other_dir cat mk_other_dir|sort -k 2n|uniq|sh cat cp_other_dir|sort -k 2n|uniq|sh rm -rf cat mk_other_dir rm -rf cat cp_other_dir rm ./all_lib rm ./other_dir rm ./so.txt du -sh ./mylib -------------------