Linux 复制粘贴 分为 缓冲区 和 系统剪贴板 1.缓冲区只能在本编辑内有效 2.系统剪贴板可以粘贴到外部 cat "content" | xclip -selection c 复制到系统剪贴板,可以粘贴到外部! 设置段 .ctors 构造函数? .dtors 析构函数?
#includevoid my_init_0(){ printf("init 0 OKn"); } void my_init_1(){ printf("init 1 OKn"); } typedef void (*ctor_t)(); __attribute__((section(".ctors"))) ctor_t my_init_0_c = my_init_0; __attribute__((section(".ctors"))) ctor_t my_init_1_c = my_init_1; int main(){ printf("main OKn"); return 0; } void my_destroy_0(){ printf("destroy 0 OKn"); } void my_destroy_1(){ printf("destroy 1 OKn"); } typedef void (*dtor_t)(); __attribute__((section(".dtors"))) ctor_t my_destroy_0_d = my_destroy_0; __attribute__((section(".dtors"))) ctor_t my_destroy_1_d = my_destroy_1;
>>$ ./a.out 127 ⨯ init 1 OK init 0 OK main OK destroy 0 OK destroy 1 OK



