Commit Graph

14 Commits

Author SHA1 Message Date
Joseph Koshy
5f2891aaa4 Document the additional error returns possible when handling ELF objects
that require extended numbering.
2006-12-25 02:24:39 +00:00
Joseph Koshy
f6c0f35e07 Keep shadow copies of the e_shnum', e_phnum' and `e_shstrndx'
members of the ELF Executable Header inside the library-private
`struct _Elf' descriptor and only update the underlying Elf{32,64}_Ehdr
structure on an elf_update(3) call.  These fields of the Ehdr
structure are technically `out of bounds' for an application program
per the ELF(3) API, but we've seen applications that initialize
a new Ehdr structure using memcpy(), messing up the library's
invariants. [1]

Implement elf_getphnum() and handle ELF objects with more than
64K program header table entries.

Reported by:	jb [1]
2006-12-25 02:22:22 +00:00
Joseph Koshy
a2dc08f2b8 Use strncpy() instead of strlcpy() when copying members of
a `struct ar_hdr'.  These members do not use NUL-termination
while strlcpy() expects its source buffer to be NUL-terminated.
2006-12-25 02:06:32 +00:00
Joseph Koshy
5eaae8bafd Correct a logic error. 2006-12-24 09:45:10 +00:00
Joseph Koshy
2dacb27e06 Use <osreldate.h> rather than the OS version reported by the kernel
to determine which Elf Types are to be handled.  Change the M4
templates to wrap an `#if __FreeBSD_version >= NNN'/`#endif' pair
around the generated code for each ELF data type, where `NNN' is
the OS version where the ELF type was added to the source tree.

This change allows cross-builds of old sources on newer FreeBSD
systems to work correctly.

Problem reported by:	ru
2006-12-18 05:40:01 +00:00
Joseph Koshy
c2f3db731e Use the correct value of __FreeBSD_version. 2006-12-18 05:36:23 +00:00
Joseph Koshy
9d4618fd66 Fix a typo. 2006-12-16 10:45:43 +00:00
Joseph Koshy
e107d208f3 Name the functions documented by this manual page correctly. 2006-12-13 15:14:46 +00:00
Joseph Koshy
61e1aeb6ee Document the ELF types supported by libelf.
Document the relationship between section types (SHT_*) and the
types known to the libelf.
2006-12-11 09:03:27 +00:00
Joseph Koshy
37ec86bb1b Make the generated message from `elf_errmsg(-1)' a little more readable. 2006-12-09 16:27:15 +00:00
Ruslan Ermilov
73eee24650 - style: use =' instead of +=' for initial assignments.
- don't add generated sources' objects to OBJS explicitly;
  GENSRCS is part of SRCS so they were already in OBJS.
2006-11-24 06:38:11 +00:00
Ruslan Ermilov
cd9e086e93 Fix minor formatting issues:
- make document title match filename;
- remove hard sentence breaks, whitespace at EOL, and double whitespace;
- sort SEE ALSO xrefs, adding missing section numbers;
- fix a misspelled macro name.
2006-11-13 09:46:16 +00:00
Joseph Koshy
9167cd6392 - Replace the use of DPSRCS with something more appropriate. DPSRCS
is for when you need something in ".depend", but not compiled in.
- Style fixes: Spell ${.OBJDIR} as ".".
- Neaten a comment.

Submitted by:	ru
2006-11-12 18:43:25 +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