Date: Thu, 17 Aug 2006 21:35:30 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 104441 for review Message-ID: <200608172135.k7HLZUTw096136@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=104441 Change 104441 by jb@jb_freebsd2 on 2006/08/17 21:34:37 IFlibbsdelf Affected files ... .. //depot/projects/dtrace/src/lib/libelf/_libelf.h#6 integrate .. //depot/projects/dtrace/src/lib/libelf/elf_errmsg.c#5 integrate .. //depot/projects/dtrace/src/lib/libelf/gelf_getehdr.3#3 integrate .. //depot/projects/dtrace/src/lib/libelf/gelf_newehdr.3#3 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf_convert.m4#7 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf_ehdr.c#3 integrate Differences ... ==== //depot/projects/dtrace/src/lib/libelf/_libelf.h#6 (text+ko) ==== @@ -107,8 +107,8 @@ Elf64_Phdr *e_phdr64; } e_phdr; union { - Elf32_Shdr *e_shdr32; - Elf64_Shdr *e_shdr64; + Elf32_Phdr *e_shdr32; + Elf64_Phdr *e_shdr64; } e_shdr; } e_elf; } e_u; ==== //depot/projects/dtrace/src/lib/libelf/elf_errmsg.c#5 (text+ko) ==== @@ -50,7 +50,8 @@ 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 API version"), + DEFINE_ERROR(NUM, "Unknown error") #undef DEFINE_ERROR }; ==== //depot/projects/dtrace/src/lib/libelf/gelf_getehdr.3#3 (text+ko) ==== @@ -99,6 +99,10 @@ does not have an associated header. .It Bq Er ELF_E_RESOURCE An out of memory condition was detected during execution. +.It Bq Er ELF_E_VERSION +The ELF descriptor +.Ar elf +had an unsupported ELF version number. .El .Sh SEE ALSO .Xr elf 3 , ==== //depot/projects/dtrace/src/lib/libelf/gelf_newehdr.3#3 (text+ko) ==== @@ -151,6 +151,10 @@ A malformed ELF header was detected. .It Bq Er ELF_E_RESOURCE An out of memory condition was detected during execution. +.It Bq Er ELF_E_VERSION +The ELF descriptor +.Ar elf +had an unsupported ELF version number. .El .Sh SEE ALSO .Xr elf 3 , ==== //depot/projects/dtrace/src/lib/libelf/libelf_convert.m4#7 (text+ko) ==== @@ -129,7 +129,9 @@ #define WRITE_XWORD(P,X) WRITE_WORD64(P,X) #define WRITE_IDENT(P,X) do { \ (void) memcpy((P), (X), sizeof((X))); \ + (P) = (P) + EI_NIDENT; \ } while (0) + /* * Read in various integral values. The source pointer could be * unaligned. Values are read in in native byte order. The source @@ -189,7 +191,7 @@ #define READ_XWORD(P,X) READ_WORD64(P,X) #define READ_IDENT(P,X) do { \ (void) memcpy((X), (P), sizeof((X))); \ - (P) = (P) + sizeof((X)); \ + (P) = (P) + EI_NIDENT; \ } while (0) divert(-1) ==== //depot/projects/dtrace/src/lib/libelf/libelf_ehdr.c#3 (text+ko) ==== @@ -66,6 +66,11 @@ return (NULL); } + if (e->e_version != EV_CURRENT) { + LIBELF_SET_ERROR(VERSION, 0); + return (NULL); + } + if (e->e_class == ELFCLASSNONE) e->e_class = ec;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608172135.k7HLZUTw096136>