gpt4 book ai didi

elf - ELF 中的 SHT_NULL 部分有什么用?

转载 作者:行者123 更新时间:2023-12-04 17:47:59 27 4
gpt4 key购买 nike

  • SHT_NULL的目的是什么? ELF 中的部分?
  • 它是由操作系统还是加载程序引用的?
  • 这个部分的大小是多少?
  • 它与 NULL 指针有什么关系吗?
  • 此外,为什么此部分在部分段映射中没有条目?

  • 来自 ELF 规范:
    SHT_NULL :该值将节头标记为非事件;它没有关联的部分。节头的其他成员具有未定义的值。

    最佳答案

    SHT_NULL的一个“用途”是第一个头表条目(索引0,名为 SHN_UNDEF )是强制性的,这很神奇。

    这记录在 System V ABI Update 上(推荐 by the LSB):

    If the number of sections is greater than or equal to SHN_LORESERVE (0xff00), e_shnum has the value SHN_UNDEF (0) and the actual number of section header table entries is contained in the sh_size field of the section header at index 0 (otherwise, the sh_size member of the initial entry contains 0).



    和:

    Other section type values are reserved. As mentioned before, the section header for index 0 (SHN_UNDEF) exists, even though the index marks undefined section references. This entry holds the following.



    后跟一个表,指定节头的每个条目在这种特殊情况下的含义。特别是 sh_type必须是 SHT_NULL .

    从上面来看,这第一部分似乎存在以允许对大量部分进行编码,但我还没有测试内核和编译器支持。

    关于elf - ELF 中的 SHT_NULL 部分有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26812142/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com