svn commit: r189919 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Tue Mar 17 02:50:41 PDT 2009


Author: kib
Date: Tue Mar 17 09:50:40 2009
New Revision: 189919
URL: http://svn.freebsd.org/changeset/base/189919

Log:
  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

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Tue Mar 17 06:54:41 2009	(r189918)
+++ head/sys/kern/imgact_elf.c	Tue Mar 17 09:50:40 2009	(r189919)
@@ -1330,14 +1330,14 @@ __elfN(check_note)(struct image_params *
     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) {


More information about the svn-src-all mailing list