ELF file headers

前端 未结 9 1069
無奈伤痛
無奈伤痛 2021-02-05 22:15

A quick question about elf file headers, I can\'t seem to find anything useful on how to add/change fields in the elf header. I\'d like to be able to change the magic numbers an

9条回答
  •  悲&欢浪女
    2021-02-05 22:50

    I don't know of linker script commands that can do this, but you can do it post-link using the objcopy command. The --add-section option can be used to add a section containing arbitrary data to the ELF file. If the ELF header doesn't contain the fields you want, just make a new section and add them there.

提交回复
热议问题