mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-23 16:01:42 +00:00
Improve compatibility with other implementations of the ELF(3) API:
when an output file has no program headers, set the 'e_phentsize' field of the ELF executable header to zero. Obtained from: elftoolchain MFC after: 1 month
This commit is contained in:
parent
e8968eb491
commit
3fd7b10a01
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210326
@ -422,8 +422,8 @@ _libelf_resync_elf(Elf *e)
|
||||
(E)->e_ident[EI_VERSION] = (V); \
|
||||
(E)->e_ehsize = _libelf_fsize(ELF_T_EHDR, (EC), (V), \
|
||||
(size_t) 1); \
|
||||
(E)->e_phentsize = _libelf_fsize(ELF_T_PHDR, (EC), (V), \
|
||||
(size_t) 1); \
|
||||
(E)->e_phentsize = (phnum == 0) ? 0 : _libelf_fsize( \
|
||||
ELF_T_PHDR, (EC), (V), (size_t) 1); \
|
||||
(E)->e_shentsize = _libelf_fsize(ELF_T_SHDR, (EC), (V), \
|
||||
(size_t) 1); \
|
||||
} while (0)
|
||||
|
Loading…
Reference in New Issue
Block a user