LD_DEBUG 是 glibc 中的 loader 为了方便自身调试而设置的一个环境变量。通过设置这个环境变量,可以方便的看到 loader 的加载过程。
LD_DEBUG=help ./main
Valid options for the LD_DEBUG environment variable are:

libs display library search paths
reloc display relocation processing
files display progress for input file
symbols display symbol table processing
bindings display information about symbol binding
versions display version dependencies
all all previous options combined
statistics display relocation statistics
unused determined unused DSOs
help display this help message and exit

To direct the debugging output into a file instead of standard output
a filename can be specified using the LD_DEBUG_OUTPUT environment variable.

用法 root@wshn$LD_DEBUG=libs ./main
4452:
find library=libc.so.6 [0]; searching
4452: search cache=/etc/ld.so.cache
4452: trying file=/lib/i386-Linux-gnu/libc.so.6
4452:
4452:
4452: calling init: /lib/i386-linux-gnu/libc.so.6
4452:
4452:
4452: initialize program: ./main
4452:
4452:
4452: transferring control: ./main
4452:
Hello
4452:
4452: calling fini: ./main [0]
4452:
4452:
4452: calling fini: /lib/i386-linux-gnu/libc.so.6 [0]
4452:
LD_DEBUG的可选参数在help里面可以看见其复用形式
LD_DEBUG=libs,symbols ./main

输出log保存可以使用LD_DEBUG=all LD_DEBUG_OUTPUT=log ./main 会生成一个output指定文件名加进程号结尾的文件

LD_DEBUG的更多相关文章

  1. c高级编程4 LD_DEBUG

    [root@monitor ~]# LD_DEBUG=help ls Valid options for the LD_DEBUG environment variable are: libs dis ...

  2. 关于LD_DEBUG (转载)

    引用 LD_DEBUGThe dynamic library loader used in linux (part of glibc) has some neat tricks. One of the ...

  3. ModelSim Simulation of RapidIO II IP Core Demonstration Testbench May Require ld_debug Command

    Solution ID: fb83262Last Modified: May 17, 2013Product Category: Intellectual PropertyProduct Area: ...

  4. Linux下memcache的安装和启动

    memcache是高性能,分布式的内存对象缓存系统,用于在动态应用中减少数据库负载,提升访问速度.据说官方所说,其用户包括twitter.digg.flickr等,都是些互联网大腕呀.目前用memca ...

  5. [原创]Centos7 从零整合LNMP一体包

    按照前几章配置好后,我们就可以把这些工具打包啦.生成LNMP一体包. # export LD_LIBRARY_PATH=/package/libmemcached/lib:$LD_LIBRARY_PA ...

  6. linux下memcached安装以及启动

    1. 准备安装文件 下载memcached与libevent的安装文件 http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz(me ...

  7. memcached服务器

    memcached是高性能的分布式内存缓存服务器,通过缓存数据库查询结果,减少数据库访问次数,提高动态web应用的速度和可扩展性.为了提高性能,memcached把数据存储在内存中,重启memcach ...

  8. 【转】Memcached安装

    解析:Memcached是什么? Memcached是由Danga Interactive开发的,高性能的,分布式的内存对象缓存系统,用于在动态应用中减少数据库负载,提升访问速度. 一.软件版本    ...

  9. 【转】error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

    错误信息: /usr/local/memcacheq/bin/memcacheq: error while loading shared libraries: libevent-2.0.so.5: c ...

随机推荐

  1. 莫烦大大TensorFlow学习笔记(8)----优化器

    一.TensorFlow中的优化器 tf.train.GradientDescentOptimizer:梯度下降算法 tf.train.AdadeltaOptimizer tf.train.Adagr ...

  2. Vue学习之路第十六篇:车型列表的添加、删除与检索项目

    又到了大家最喜欢的项目练习阶段,学以致用,今天我们要用前几篇的学习内容实现列表的添加与删除. 学前准备: ①:JavaScript中的splice(index,i)方法:从已知数组的index下标开始 ...

  3. 计蒜客 第 m 大的身份证号码 (水)

    链接 : Here! 思路 : 水题 代码 : #include <cstdio> #include <string> #include <iostream> #i ...

  4. Project Euler 14 Longest Collatz sequence

    题意:对于任意一个数 N ,寻找在 100,0000 之内按照规则( N 为奇数 N = N * 3 + 1 ,N 为偶数 N = N / 2 ,直到 N = 1 时的步数 )步数的最大值 思路:记忆 ...

  5. fs

    yum install -y make expat-devel git gcc-c++ autoconf automake libtool wget python-devel ncurses-deve ...

  6. spring data JPA使用quartz定时器的具体实现

    第一步.在pom.xml中的配置 <!--quartz--> <dependency> <groupId>org.quartz-scheduler</grou ...

  7. BA--三相异步电机_星三角降压启动

    星一三角启动就是一种简单方便的降压启动方式,同时还可通过手动和自动操作控制方式实现. 星三角起动的优点还是很显著的,因为同任何别的减压起动器相比较,其结构最简单,价格也最便宜 除此之外,星三角起动方式 ...

  8. BA-Honeywell R300系统

  9. My SQL中show命令--MySQL中帮助查看

    My SQL中show命令--MySQL中帮助查看 学习了:http://hahaxiao.techweb.com.cn/archives/477.html 在mysql命令界面内,输入help或者? ...

  10. 【翻译自mos文章】 在错误的从os级别remove掉 trace file 之后,怎么找到该trace file的内容?

    在错误的从os级别remove掉 trace file 之后,怎么找到该trace file的内容? 參考原文: How to Find the Content of Trace File Gener ...