Linux
文章平均质量分 79
youngseaz
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
__attribute__
前言本文介绍__attribute__ 的使用方法__attribute__介绍要了解Linux Kernel代码的分段信息,需要了解一下gcc的__attribute__的编绎属性,__attribute__主要用于改变所声明或定义的函数或 数据的特性,它有很多子项,用于改变作用对象的特性。比如对函数,noline将禁止进行内联扩展、noreturn表示没有返回值、pure表明函数除 返回值外,不会通过其它(如全局变量、指针)对函数外部产生任何影响。子项描述section将变原创 2020-11-12 01:04:21 · 2115 阅读 · 0 评论 -
plt表、got表与延迟绑定(Lazy Binding)
准备实验环境Ubuntu-Desktop 18.04$ uname -aLinux ubuntu 5.4.0-48-generic #52~18.04.1-Ubuntu SMP Thu Sep 10 12:50:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linuxso.2.27源码源码程序如下,我将其命名为plt.c#include<stdio.h>int main(){ puts("learning plt and got!\n");原创 2020-11-09 20:34:41 · 1607 阅读 · 0 评论 -
手拆ELF(三,节区头表)
节区头表节区头的数据结构为Elf32_Shdr,大小为40字节,其数据结构如下:/* Section header. */typedef struct{ Elf32_Word sh_name; /* Section name (string tbl index) */ Elf32_Word sh_type; /* Section type */ Elf32_Word sh_flags; /* Section flags */ Elf32_Addr sh_addr; /*原创 2020-10-19 23:53:59 · 792 阅读 · 0 评论 -
glibc动态内存管理
GNU分配器翻译自 referenceGNU C库的malloc函数实现来自ptmalloc(pthreads malloc),而pthmalloc又用dlmalloc(Doug Lea malloc)实现。malloc函数有两种不同的内存分配方法,这取决于开辟空间的大小或用户传入的具体参数,最常见的分配方法是从一大块连续的内存区域分配一部分出来,并管理这些相邻的区块以优化其使用和减少浪费不可...原创 2020-02-18 11:10:54 · 438 阅读 · 0 评论 -
简单几步体验Linux内核编译
下载源代码官网下载解压内核xz -d linux-4.xx.x.tar.xztar -xf linux.4.xx.x.tar我把解压的内核源码重命名为mykernel,并将其复制到/usr/src/目录下---&amp;amp;amp;gt;/usr/src/mykernel如何安装并接触源代码系统内核源代码一般安装在/usr/src/linux目录下,但请注意,不要把这个源码树用于开发,因为编译你的C库...原创 2018-12-18 11:56:20 · 251 阅读 · 0 评论 -
初步Linux内核模块编程
基本命令lsmod // 查看当前已加载的模块insmod testmodule.ko // 加载testmodule模块rmmod testmodule // 卸载*模块简单实例模块源代码如下// 源码来自《操作系统概念-第九版》// 《operating system concepts, 9th edition》#...原创 2018-12-24 21:49:01 · 494 阅读 · 0 评论 -
构建Linux内核扩展模块
官方文档Building External ModulesThis document describes how to build an out-of-tree kernel module.=== Table of Contents=== 1 Introduction=== 2 How to Build External Modules --- 2.1 Command Syntax...转载 2018-12-24 22:03:21 · 893 阅读 · 0 评论
分享