慢慢欣赏linux 内核镜像剖析

linux kernel 5.0内核elf信息

rlk@rlk:runninglinuxkernel_5.0$ readelf -h vmlinux
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           AArch64
  Version:                           0x1
  Entry point address:               0xffff000010080000
  Start of program headers:          64 (bytes into file)
  Start of section headers:          199425544 (bytes into file)	// 0xbe2fe08
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         4
  Size of section headers:           64 (bytes)
  Number of section headers:         40
  Section header string table index: 39
rlk@rlk:runninglinuxkernel_5.0$ readelf -S vmlinux
There are 40 section headers, starting at offset 0xbe2fe08:

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .head.text        PROGBITS         ffff000010080000  00010000
       0000000000001000  0000000000000000  AX       0     0     4096
  [ 2] .text             PROGBITS         ffff000010081000  00011000
       000000000188d248  0000000000000008  AX       0     0     2048
  [ 3] .rodata           PROGBITS         ffff000011910000  018a0000
       00000000002cf179  0000000000000000  WA       0     0     4096
  [ 4] .init.eh_frame    PROGBITS         ffff000011bdf180  01b6f180
       0000000000001b70  0000000000000000   A       0     0     8
  [ 5] .pci_fixup        PROGBITS         ffff000011be0cf0  01b70cf0
       0000000000001fa0  0000000000000000   A       0     0     16
  [ 6] __ksymtab         PROGBITS         ffff000011be2c90  01b72c90
       0000000000007fd0  0000000000000000   A       0     0     8
  [ 7] __ksymtab_gpl     PROGBITS         ffff000011beac60  01b7ac60
       0000000000006ed8  0000000000000000   A       0     0     8
  [ 8] __kcrctab         PROGBITS         ffff000011bf1b38  01b81b38
       0000000000003fe8  0000000000000000   A       0     0     4
  [ 9] __kcrctab_gpl     PROGBITS         ffff000011bf5b20  01b85b20
       000000000000376c  0000000000000000   A       0     0     1
  [10] __ksymtab_strings PROGBITS         ffff000011bf928c  01b8928c
       000000000002448a  0000000000000000   A       0     0     1
  [11] __param           PROGBITS         ffff000011c1d718  01bad718
       0000000000001bf8  0000000000000000   A       0     0     8
  [12] __modver          PROGBITS         ffff000011c1f310  01baf310
       0000000000000cf0  0000000000000000   A       0     0     8
  [13] __ex_table        PROGBITS         ffff000011c20000  01bb0000
       0000000000002120  0000000000000000   A       0     0     8
  [14] .notes            NOTE             ffff000011c22120  01bb2120
       0000000000000048  0000000000000000   A       0     0     4
  [15] .init.text        PROGBITS         ffff000011c30000  01bc0000
       00000000000c5b88  0000000000000000  AX       0     0     8
  [16] .exit.text        PROGBITS         ffff000011cf5b88  01c85b88
       0000000000003274  0000000000000000  AX       0     0     4
  [17] .altinstructions  PROGBITS         ffff000011cf8dfc  01c88dfc
       000000000006363c  0000000000000000   A       0     0     1
  [18] .altinstr_replace PROGBITS         ffff000011d5c438  01cec438
       000000000004df78  0000000000000000  AX       0     0     4
  [19] .init.data        PROGBITS         ffff000011dab000  01d3b000
       00000000000691c0  0000000000000000  WA       0     0     256
  [20] .data..percpu     PROGBITS         ffff000011e15000  01da5000
       0000000000014cd8  0000000000000000  WA       0     0     64
  [21] .rela.dyn         RELA             ffff000011e29cd8  01db9cd8
       0000000000298ff8  0000000000000018   A       0     0     8
  [22] .data             PROGBITS         ffff0000120d0000  02060000
       00000000000fc408  0000000000000000  WA       0     0     4096
  [23] .got.plt          PROGBITS         ffff0000121cc408  0215c408
       0000000000000018  0000000000000008  WA       0     0     8
  [24] __bug_table       PROGBITS         ffff0000121cc420  0215c420
       000000000001a604  0000000000000000  WA       0     0     4
  [25] .mmuoff.data.writ PROGBITS         ffff0000121e7000  02177000
       000000000000000c  0000000000000000  WA       0     0     2048
  [26] .mmuoff.data.read PROGBITS         ffff0000121e7800  02177800
       0000000000000008  0000000000000000  WA       0     0     8
  [27] .pecoff_edata_pad PROGBITS         ffff0000121e7808  02177808
       00000000000001f8  0000000000000000  WA       0     0     1
  [28] .bss              NOBITS           ffff0000121e8000  02177a00
       00000000000967f0  0000000000000000  WA       0     0     4096
  [29] .comment          PROGBITS         0000000000000000  02177a00
       0000000000000024  0000000000000001  MS       0     0     1
  [30] .debug_line       PROGBITS         0000000000000000  02177a24
       0000000000c29ec9  0000000000000000           0     0     1
  [31] .debug_info       PROGBITS         0000000000000000  02da18ed
       000000000857dc69  0000000000000000           0     0     1
  [32] .debug_abbrev     PROGBITS         0000000000000000  0b31f556
       0000000000391423  0000000000000000           0     0     1
  [33] .debug_aranges    PROGBITS         0000000000000000  0b6b0980
       0000000000020770  0000000000000000           0     0     16
  [34] .debug_str        PROGBITS         0000000000000000  0b6d10f0
       000000000023b231  0000000000000001  MS       0     0     1
  [35] .debug_ranges     PROGBITS         0000000000000000  0b90c330
       0000000000099360  0000000000000000           0     0     16
  [36] .debug_loc        PROGBITS         0000000000000000  0b9a5690
       0000000000042ec3  0000000000000000           0     0     1
  [37] .symtab           SYMTAB           0000000000000000  0b9e8558
       00000000002973a8  0000000000000018          38   87525     8
  [38] .strtab           STRTAB           0000000000000000  0bc7f900
       00000000001b033d  0000000000000000           0     0     1
  [39] .shstrtab         STRTAB           0000000000000000  0be2fc3d
       00000000000001c4  0000000000000000           0     0     1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  p (processor specific)

参考文档
奔跑吧 linux内核

ARM64 Linux的启动分析
https://www.pianshen.com/article/11581301916/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值