![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux c/c++
bluesandmetal
这个作者很懒,什么都没留下…
展开
-
ELF动态链接
ELF动态链接 一.链接器ld-linux.so.2 链接器在.interp section中 动态库运行时查找动态库的顺序: 1 (ELF only).dynamic 中的RPATH, 编译时使用 -Wl,-rpath=指定,例如-Wl,-rpath=. 程序执行时会在当前目录下寻找动态库。 -Wl,-rpath=支持环境变量,如export MYDIR=/mnt; -Wl,-rp原创 2013-01-28 10:29:27 · 362 阅读 · 0 评论 -
C++ specialization.txt
explicit specialization 也称显式特化,全特化,显式具体化 使用明确的类型来代替模板中的类型参数 函数: 函数在全局则可以全特化,在普通类(非模板类)内部则不能, 例如 template T abc(T &a, U& b) { std::cout return a; } template char abc(char &a, int &b)原创 2013-01-28 10:30:19 · 331 阅读 · 0 评论 -
C++ 对象内存分布
objdump -t test 64位系统上的输出 .text 00000000004006c0 l d .text 0000000000000000 .text 代码段。 .rodata 0000000000400b40 l d .rodata 0000000000000000原创 2013-01-28 10:28:40 · 471 阅读 · 0 评论 -
GCC文档中比较大小的宏定义
#define max(a,b) ((a) > (b) ? (a) : (b)) But this definition computes either a or b twice, with bad results if the operand has side effects. In GNU C, if you know the type of the operands (here take原创 2013-01-28 10:36:44 · 898 阅读 · 0 评论 -
二级指针操作链表的小技巧
内核中register_filesystem函数 struct file_system_type ** p; p = find_filesystem(fs->name, strlen(fs->name)); 返回的是最后一个节点的next指针的地址 if (*p) *p存在说明不是最后一个节点。 res原创 2013-01-29 15:20:09 · 472 阅读 · 0 评论