From 37de637d3128736c24e3f0668ae8f42e58707d4b Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 17 Mar 2009 09:50:40 +0000 Subject: 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 --- sys/kern/imgact_elf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index f2bdcf5..5604ea5 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -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) { -- cgit v1.1