程序员的自我修养
track_down
这个作者很懒,什么都没留下…
展开
-
在main之前运行 忘.init段和.ctors段添加函数
#include <stdio.h> void __attribute__((section(".init"))) test_init() { printf("this is test_init\n"); } void my_init() __attribute__((constructor)); void my_init() { printf("this is ...原创 2020-02-15 16:11:00 · 674 阅读 · 0 评论 -
c语言 时光倒流函数
#include <stdio.h> #include <setjmp.h> #define print(args...) fprintf(stdout, ##args) jmp_buf b; void f() { longjmp(b, 1); } int main() { if (setjmp(b)) { printf("world!...原创 2020-02-15 15:54:32 · 822 阅读 · 0 评论 -
共享库版本兼容性
目前共性库和共享对象是一个概念 当共享库版本升级需要改动接口的时候就会出现共享库版本兼容问题 这里的接口主要是指ABI接口(诸如: 函数调用的堆栈结构 符号命名 参数规则 数据结构的内存布局 函数入栈顺序等) ...原创 2020-01-31 23:40:56 · 153 阅读 · 0 评论