linux - 错误 : ld. 所以:无法预加载对象 LD_PRELOAD:忽略

标签 linux bash

我使用的是 ubuntu 12.04。每次我启动我的 bash 终端并且每次我完成输入命令(然后按回车键)时,我都会收到以下消息:

ERROR: ld.so: object '/usr/lib/liblunar-calendar-preload.so' from LD_PRELOAD cannot be preloaded: ignored.

这很奇怪。 那么环境变量 LD_PRELOAD 是干什么用的呢?幕后发生了什么?

谢谢。

最佳答案

链接器会考虑一些环境变量。一个是 LD_PRELOAD

来自 man 8 ld-linux:

LD_PRELOAD
          A whitespace-separated list of additional,  user-specified,  ELF
          shared  libraries  to  be loaded before all others.  This can be
          used  to  selectively  override  functions   in   other   shared
          libraries.   For  setuid/setgid  ELF binaries, only libraries in
          the standard search directories that are  also  setgid  will  be
          loaded.

因此,链接器将在加载其他库之前尝试加载 LD_PRELOAD 变量中列出的库。

如果在变量中列出了一个无法预加载的库,这可能是什么情况。查看设置了 LD_PRELOAD.bashrc.bash_profile 环境,然后从变量中删除该库。

关于linux - 错误 : ld. 所以:无法预加载对象 LD_PRELOAD:忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17723666/

相关文章:

android - 选择安卓wifi channel

multithreading - bash:写入命名管道是原子的吗?

bash - 如何在 Bash 中的另一个函数中定义一个函数?

linux - 在哪里指向编译标志?

html - Bash:发送带有附件的 HTML?

linux - 使用 linux 脚本命令

linux - awk 在 bash 脚本中使用引号和空格

git - 在 git pre-commit hook 中临时修改工作目录和暂存区

bash - 如何使用 vim 打开目录下的每个 .txt 文件(使用 Bash)

linux - 如何在 Bash 脚本中回答是