History log of /freebsd-10-stable/lib/libelf/elf_update.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 247221 24-Feb-2013 markj

Merge part of r1712 from elftoolchain, making it possible to resize ELF
sections and indirectly change the layout of an ELF file when
ELF_F_LAYOUT is not set.

PR: bin/167103
Approved by: rstone (co-mentor)
Obtained from: elftoolchain
MFC after: 2 weeks


# 212373 09-Sep-2010 kaiw

libelf is overly strict about the type and alignment of Elf_Data
objects inside one ELF section, which prevents the creation of a ELF
section with mixed data types. For example, gcc LTO use libelf to
create a .gnu_lto_XXX section that contains integers and a string
table, which doesn't work with our libelf implementation.

The changes made in this commit include:
* Allow Elf_Data type to be different than section type.
* Relax Elf_Data alignment check.
* Align each Elf_Data by their own alignment instead of section alignment.

MFC after: 1 month


# 210347 21-Jul-2010 kaiw

Fix a memory leak.

Obtained from: elftoolchain
MFC after: 1 month


# 210330 21-Jul-2010 kaiw

Allow an application that updates only the ELF Ehdr to work.

Obtained from: elftoolchain
MFC after: 1 month


# 210328 21-Jul-2010 kaiw

Bug fix: permit the creation of zero-sized sections.

Obtained from: elftoolchain
MFC after: 1 month


# 210326 21-Jul-2010 kaiw

Improve compatibility with other implementations of the ELF(3) API:
when an output file has no program headers, set the 'e_phentsize'
field of the ELF executable header to zero.

Obtained from: elftoolchain
MFC after: 1 month


# 210321 21-Jul-2010 kaiw

Remove a superfluous comment.

Obtained from: elftoolchain
MFC after: 1 month


# 177367 19-Mar-2008 jkoshy

Ensure that the section header table is written out in an order
consistent with the section indices returned to the application by
elf_ndxscn().

Submitted by: kaiw


# 176758 03-Mar-2008 jkoshy

- Fix an off-by-one bug in _libelf_insert_section(). [1]
- Update (c) years.

Submitted by: kaiw [1]


# 172088 08-Sep-2007 jkoshy

Fix a bug that prevented applications from laying out ELF objects
with section header tables residing in between other sections.

Introduce additional checks for overlaps between section data and
the section header table when the application is performing section
layout.

Document additional error returns.

Reported by: Kai Wang <kaiw27 at gmail dot com>
Approved by: re (rwatson)


# 165535 25-Dec-2006 jkoshy

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]


# 164190 11-Nov-2006 jkoshy

MFP4: Add an implementation of the ELF(3) and GELF(3) API set.

Bump __FreeBSD_version.

Reviewed by: jb