Use the properly sized types for ELF object header and program headers.
This fixes osrel fetching from the FreeBSD branding note for the 64bit platforms. Reported by: swell.k gmail com Reviewed by: dchagin Tested by: dchagin, swell.k gmail com
This commit is contained in:
parent
8d3fb5e2bc
commit
429f5a589b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189919
@ -1330,14 +1330,14 @@ __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote,
|
||||
int32_t *osrel)
|
||||
{
|
||||
const Elf_Note *note, *note_end;
|
||||
const Elf32_Phdr *phdr, *pnote;
|
||||
const Elf32_Ehdr *hdr;
|
||||
const Elf_Phdr *phdr, *pnote;
|
||||
const Elf_Ehdr *hdr;
|
||||
const char *note_name;
|
||||
int i;
|
||||
|
||||
pnote = NULL;
|
||||
hdr = (const Elf32_Ehdr *)imgp->image_header;
|
||||
phdr = (const Elf32_Phdr *)(imgp->image_header + hdr->e_phoff);
|
||||
hdr = (const Elf_Ehdr *)imgp->image_header;
|
||||
phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
|
||||
|
||||
for (i = 0; i < hdr->e_phnum; i++) {
|
||||
if (phdr[i].p_type == PT_NOTE) {
|
||||
|
Loading…
Reference in New Issue
Block a user