Commit Graph

4 Commits

Author SHA1 Message Date
Kai Wang
f0f10541db Perform additional checks when translating between file and memory
representations of ELF types.

The ELF(3) API allows applications to request a conversion that is
`in-place', i.e., with source and destinations data buffers being
the same.  However, the file and memory sizes of ELF sections that
have additional internal structure, such as those of type `Elf_Note',
or `Elf_GNU_Hash_Header', can be determined only known after the
type-specific headers that comprise the first few words in these
sections are read and translated.

Pass in the size of destination buffer to type translation routines
in "libelf_convert.m4" and have these routines return an error code
if the translated data would not fit inside the destination buffer.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 10:25:02 +00:00
Joseph Koshy
742fe6de5d - Allow source descriptors with no data to be used as arguments to the
elf{32,64}_xlateto[fm]() translation functions.  This change makes our
  libelf compatible with other ELF(3) implementations. [1]
- Update manual page to reflect this change.
- Style fixes: wrap a long line.

Submitted by:	jb [1]
2007-11-26 03:09:33 +00:00
Joseph Koshy
5eaae8bafd Correct a logic error. 2006-12-24 09:45:10 +00:00
Joseph Koshy
3eb1a62e69 MFP4: Add an implementation of the ELF(3) and GELF(3) API set.
Bump __FreeBSD_version.

Reviewed by:	jb
2006-11-11 17:16:35 +00:00