Date: Sat, 19 Aug 2006 21:30:47 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 104565 for review Message-ID: <200608192130.k7JLUlpO018348@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608192130.k7JLUlpO018348>