小编USE*_*372的帖子

错误:LOAD 段未覆盖 PHDR 段

我正在从文本“Operating Systems from 0 to 1”中学习如何链接脚本,并且在文本中他们展示了一个使用关键字 PHDRS 的示例;

ENTRY(main);
    
PHDRS
{
    headers PT_PHDR FILEHDR PHDRS;
    code PT_LOAD FILEHDR;
}
    
SECTIONS /*top level command that declares a list of custom program sections, ld provides set of such instructions.*/
{
    . = 0x10000; /* set location counter to address 0x10000, base address for subsequent commands */
    .text : { *(.text) } :code /* final .text section begins at address 0x1000, combines all .text sections from obj files into one final*/
    . = …
Run Code Online (Sandbox Code Playgroud)

c gnu elf linker-scripts

6
推荐指数
1
解决办法
6468
查看次数

标签 统计

c ×1

elf ×1

gnu ×1

linker-scripts ×1