Date: Wed, 25 Oct 2006 06:51:09 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 108390 for review Message-ID: <200610250651.k9P6p9IT098139@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=108390 Change 108390 by jb@jb_freebsd7 on 2006/10/25 06:51:03 IFlibbsdelf Affected files ... .. //depot/projects/dtrace/src/lib/libelf/elf_types.m4#3 integrate .. //depot/projects/dtrace/src/lib/libelf/gelf_getphdr.3#2 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf.c#4 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf.h#9 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf_convert.m4#9 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf_fsize.m4#4 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf_msize.m4#3 integrate .. //depot/projects/dtrace/src/lib/libelf/libelf_phdr.c#2 integrate Differences ... ==== //depot/projects/dtrace/src/lib/libelf/elf_types.m4#3 (text+ko) ==== @@ -35,6 +35,7 @@ `DYN, Dyn', `EHDR, Ehdr', `HALF, Half', + `LWORD, Lword', `MOVE, Move', `MOVEP, MoveP', `NOTE, Note', @@ -62,7 +63,7 @@ * in the sequence used in the file representation of `NAME'. * * Each member list element comprises a pair containing a field name - * and a basic type. Basic types include IDENT, HALF, WORD, + * and a basic type. Basic types include IDENT, HALF, WORD, LWORD, * ADDR{32,64}, OFF{32,64}, SWORD, XWORD, SXWORD. * * The last element of a member list is the null element: `_,_'. @@ -70,6 +71,16 @@ define(`DEFINE_STRUCT',`define(`$1_DEF',shift($@))dnl') +DEFINE_STRUCT(`Elf32_Cap', + ``c_tag, WORD', + `c_un.c_val, WORD', + `_,_'') + +DEFINE_STRUCT(`Elf64_Cap', + ``c_tag, XWORD', + `c_un.c_val, XWORD', + `_,_'') + DEFINE_STRUCT(`Elf32_Dyn', ``d_tag, SWORD', `d_un.d_ptr, WORD', @@ -114,6 +125,22 @@ `e_shstrndx, HALF', `_,_'') +DEFINE_STRUCT(`Elf32_Move', + ``m_value, LWORD', + `m_info, WORD', + `m_poffset, WORD', + `m_repeat, HALF', + `m_stride, HALF', + `_,_'') + +DEFINE_STRUCT(`Elf64_Move', + ``m_value, LWORD', + `m_info, XWORD', + `m_poffset, XWORD', + `m_repeat, HALF', + `m_stride, HALF', + `_,_'') + DEFINE_STRUCT(`Elf32_Phdr', ``p_type, WORD', `p_offset, OFF', @@ -202,6 +229,16 @@ `st_size, XWORD', `_,_'') +DEFINE_STRUCT(`Elf32_Syminfo', + ``si_boundto, HALF', + `si_flags, HALF', + `_,_'') + +DEFINE_STRUCT(`Elf64_Syminfo', + ``si_boundto, HALF', + `si_flags, HALF', + `_,_'') + DEFINE_STRUCT(`Elf32_Verdaux', ``vda_name, WORD', `vda_next, WORD', ==== //depot/projects/dtrace/src/lib/libelf/gelf_getphdr.3#2 (text+ko) ==== @@ -41,7 +41,7 @@ .Fn elf64_getphdr "Elf *elf" .In gelf.h .Ft "GElf_Phdr *" -.Fn gelf_getehdr "Elf *elf" "int index" "GElf_Phdr *dst" +.Fn gelf_getphdr "Elf *elf" "int index" "GElf_Phdr *dst" .Sh DESCRIPTION These functions retrieve and translate ELF program header information from an ELF descriptor, if this information exists. @@ -104,12 +104,24 @@ Index .Ar index was out of range. +.It Bq Er ELF_E_CLASS +The class of ELF descriptor +.Ar elf +did not match the expected class of the function being called. .It Bq Er ELF_E_HEADER ELF descriptor .Ar elf did not possess an executable header. +.It Bq Er ELF_E_HEADER +ELF descriptor +.Ar elf +had a corrupt executable header. .It Bq Er ELF_E_RESOURCE An out of memory condition was detected. +.It Bq Er ELF_VERSION +ELF descriptor +.Ar elf +was of an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , ==== //depot/projects/dtrace/src/lib/libelf/libelf.c#4 (text+ko) ==== @@ -71,13 +71,13 @@ static struct memalign memalign[ELF_T_NUM] = { [ELF_T_ADDR] = ALIGNMENT(Addr), [ELF_T_BYTE] = { .ma32 = 1, .ma64 = 1 }, - [ELF_T_CAP] = UNSUPPORTED(), + [ELF_T_CAP] = ALIGNMENT(Cap), [ELF_T_DYN] = ALIGNMENT(Dyn), [ELF_T_EHDR] = ALIGNMENT(Ehdr), [ELF_T_HALF] = ALIGNMENT(Half), - [ELF_T_MOVE] = UNSUPPORTED(), + [ELF_T_MOVE] = ALIGNMENT(Move), [ELF_T_MOVEP] = UNSUPPORTED(), - [ELF_T_NOTE] = UNSUPPORTED(), + [ELF_T_NOTE] = ALIGNMENT(Nhdr), [ELF_T_OFF] = ALIGNMENT(Off), [ELF_T_PHDR] = ALIGNMENT(Phdr), [ELF_T_REL] = ALIGNMENT(Rel), @@ -85,7 +85,7 @@ [ELF_T_SHDR] = ALIGNMENT(Shdr), [ELF_T_SWORD] = ALIGNMENT(Sword), [ELF_T_SXWORD] = ALIGN64(Sxword), - [ELF_T_SYMINFO] = UNSUPPORTED(), + [ELF_T_SYMINFO] = ALIGNMENT(Syminfo), [ELF_T_SYM] = ALIGNMENT(Sym), #if __FreeBSD_version >= 700009 [ELF_T_VDEF] = ALIGNMENT(Verdef), ==== //depot/projects/dtrace/src/lib/libelf/libelf.h#9 (text+ko) ==== @@ -58,6 +58,7 @@ ELF_T_DYN, ELF_T_EHDR, ELF_T_HALF, + ELF_T_LWORD, ELF_T_MOVE, ELF_T_MOVEP, ELF_T_NOTE, ==== //depot/projects/dtrace/src/lib/libelf/libelf_convert.m4#9 (text+ko) ==== @@ -74,9 +74,10 @@ (X) = _t; \ } while (0) #define SWAP_ADDR64(X) SWAP_WORD64(X) +#define SWAP_LWORD(X) SWAP_WORD64(X) #define SWAP_OFF64(X) SWAP_WORD64(X) +#define SWAP_SXWORD(X) SWAP_WORD64(X) #define SWAP_XWORD(X) SWAP_WORD64(X) -#define SWAP_SXWORD(X) SWAP_WORD64(X) /* * Write out various integral values. The destination pointer could @@ -124,6 +125,7 @@ (P) = _p + 8; \ } while (0) #define WRITE_ADDR64(P,X) WRITE_WORD64(P,X) +#define WRITE_LWORD(P,X) WRITE_WORD64(P,X) #define WRITE_OFF64(P,X) WRITE_WORD64(P,X) #define WRITE_SXWORD(P,X) WRITE_WORD64(P,X) #define WRITE_XWORD(P,X) WRITE_WORD64(P,X) @@ -186,6 +188,7 @@ (X) = _t; \ } while (0) #define READ_ADDR64(P,X) READ_WORD64(P,X) +#define READ_LWORD(P,X) READ_WORD64(P,X) #define READ_OFF64(P,X) READ_WORD64(P,X) #define READ_SXWORD(P,X) READ_WORD64(P,X) #define READ_XWORD(P,X) READ_WORD64(P,X) @@ -227,11 +230,8 @@ `define(IGNORE_$1`'32, 1) define(IGNORE_$1`'64, 1)') -IGNORE(CAP) -IGNORE(MOVE) IGNORE(MOVEP) IGNORE(NOTE) -IGNORE(SYMINFO) ifelse(eval(OSRELDATE < 700009),1, `IGNORE(VDEF) @@ -250,6 +250,7 @@ define(`BASE_BYTE', 1) define(`BASE_HALF', 1) define(`BASE_WORD', 1) +define(`BASE_LWORD', 1) define(`BASE_SWORD', 1) define(`BASE_XWORD', 1) define(`BASE_SXWORD', 1) ==== //depot/projects/dtrace/src/lib/libelf/libelf_fsize.m4#4 (text+ko) ==== @@ -47,11 +47,8 @@ define(`IDENT_SIZE', `EI_NIDENT') /* Currently unimplemented types */ -define(`CAP_SIZE', 0) -define(`MOVE_SIZE', 0) define(`MOVEP_SIZE', 0) define(`NOTE_SIZE', 0) -define(`SYMINFO_SIZE', 0) /* Overrides for 32 bit types that do not exist */ define(`XWORD_SIZE32', 0) ==== //depot/projects/dtrace/src/lib/libelf/libelf_msize.m4#3 (text+ko) ==== @@ -52,11 +52,8 @@ /* * Unimplemented types. */ -define(CAP_SIZE, 0) -define(MOVE_SIZE, 0) define(MOVEP_SIZE, 0) define(NOTE_SIZE, 0) -define(SYMINFO_SIZE, 0) define(SXWORD_SIZE32, 0) define(XWORD_SIZE32, 0) ==== //depot/projects/dtrace/src/lib/libelf/libelf_phdr.c#2 (text+ko) ==== @@ -82,7 +82,7 @@ assert(fsz > 0); - if ((uint64_t) e->e_rawsize <= (phoff + fsz)) { + if ((uint64_t) e->e_rawsize < (phoff + fsz)) { LIBELF_SET_ERROR(HEADER, 0); return (NULL); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610250651.k9P6p9IT098139>