Chinaunix

标题: 可执行文件的符号链接无效 [打印本页]

作者: bijianing    时间: 2011-09-03 17:11
标题: 可执行文件的符号链接无效
对一个可执行文件做符号链接,但是通过符号链接文件执行,就出错

我的系统:Fedora 14 x86_64
下面是执行命令的过程:
  1. [bjn@ggjd test]$ ls -l
  2. 总用量 96
  3. -rwxrwxr-x 1 bjn bjn 89540  9月  3 18:08 ccache
  4. [bjn@ggjd test]$ file ccache
  5. ccache: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
  6. [bjn@ggjd test]$ ln -s ccache lcc
  7. [bjn@ggjd test]$ ls -l
  8. 总用量 96
  9. -rwxrwxr-x 1 bjn bjn 89540  9月  3 18:08 ccache
  10. lrwxrwxrwx 1 bjn bjn     6  9月  3 18:09 lcc -> ccache
  11. [bjn@ggjd test]$ ./lcc
  12. lcc: No such file or directory
  13. [bjn@ggjd test]$ ./ccache
  14. ccache, a compiler cache. Version 2.4
  15. Copyright Andrew Tridgell, 2002

  16. Usage:
  17. ...
复制代码
这是为什么呢????
作者: Missex    时间: 2011-09-03 20:00
file lcc 显示什么?

可能这个程序ccache有内部特殊的处理, 不允许改变名称

你这么做试试呢

mkdir ttt
ln -sv ccache ttt/ccache
ttt/ccache
作者: bijianing    时间: 2011-09-04 10:26
谢谢楼上,按照你的说法的确好用,谢谢。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2