From owner-p4-projects@FreeBSD.ORG Sat Aug 19 21:31:02 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AC57516A4E0; Sat, 19 Aug 2006 21:31:02 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FDCE16A4DE for ; Sat, 19 Aug 2006 21:31:02 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5259A43D97 for ; Sat, 19 Aug 2006 21:30:48 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7JLUmfW018351 for ; Sat, 19 Aug 2006 21:30:48 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7JLUlpO018348 for perforce@freebsd.org; Sat, 19 Aug 2006 21:30:47 GMT (envelope-from jb@freebsd.org) Date: Sat, 19 Aug 2006 21:30:47 GMT Message-Id: <200608192130.k7JLUlpO018348@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 104565 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 21:31:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=104565 Change 104565 by jb@jb_freebsd2 on 2006/08/19 21:30:29 IFlibbsdelf Affected files ... .. //depot/projects/dtrace/src/lib/libelf/elf_errmsg.c#6 integrate .. //depot/projects/dtrace/src/lib/libelf/gelf_getehdr.3#4 integrate .. //depot/projects/dtrace/src/lib/libelf/gelf_newehdr.3#4 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf.h#5 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf_ehdr.c#4 integrate Differences ... ==== //depot/projects/dtrace/src/lib/libelf/elf_errmsg.c#6 (text+ko) ==== @@ -50,7 +50,7 @@ DEFINE_ERROR(STAT, "Cannot determine file parameters"), DEFINE_ERROR(TRUNCATE, "File truncation failed"), DEFINE_ERROR(UNIMPL, "Feature is unimplemented"), - DEFINE_ERROR(VERSION, "Unknown API version"), + DEFINE_ERROR(VERSION, "Unknown ELF API version"), DEFINE_ERROR(NUM, "Unknown error") #undef DEFINE_ERROR }; ==== //depot/projects/dtrace/src/lib/libelf/gelf_getehdr.3#4 (text+ko) ==== @@ -93,6 +93,10 @@ Argument .Ar dst was null. +.It Bq Er ELF_E_CLASS +The ELF class of descriptor +.Ar elf +did not match that of the API function being called. .It Bq Er ELF_E_HEADER ELF descriptor .Ar elf ==== //depot/projects/dtrace/src/lib/libelf/gelf_newehdr.3#4 (text+ko) ==== @@ -147,6 +147,10 @@ .Dv ELFCLASSNONE and did not match the argument .Ar elfclass . +.It Bq Er ELF_E_CLASS +The ELF class of descriptor +.Ar elf +did not match that of the API function being called. .It Bq Er ELF_E_HEADER A malformed ELF header was detected. .It Bq Er ELF_E_RESOURCE ==== //depot/projects/dtrace/src/lib/libelf/libelf.h#5 (text+ko) ==== @@ -140,7 +140,7 @@ ELF_E_NONE, /* No error */ ELF_E_ARCHIVE, /* Malformed ar(1) archive */ ELF_E_ARGUMENT, /* Invalid argument */ - ELF_E_CLASS, /* ELF class mismatch */ + ELF_E_CLASS, /* Mismatched ELF class */ ELF_E_HEADER, /* Missing or malformed ELF header */ ELF_E_MMAP, /* File mapping failed */ ELF_E_MODE, /* Wrong mode for ELF descriptor */ ==== //depot/projects/dtrace/src/lib/libelf/libelf_ehdr.c#4 (text+ko) ==== @@ -59,13 +59,16 @@ assert(ec == ELFCLASS32 || ec == ELFCLASS64); - if (e == NULL || - e->e_kind != ELF_K_ELF || - (e->e_class != ELFCLASSNONE && e->e_class != ec)) { + if (e == NULL || e->e_kind != ELF_K_ELF) { LIBELF_SET_ERROR(ARGUMENT, 0); return (NULL); } + if (e->e_class != ELFCLASSNONE && e->e_class != ec) { + LIBELF_SET_ERROR(CLASS, 0); + return (NULL); + } + if (e->e_version != EV_CURRENT) { LIBELF_SET_ERROR(VERSION, 0); return (NULL);