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
`_libelf_ar_open()` to a new compilation unit "libelf_ar_util.c"
to break the circular dependency between "elf_memory.o" and
"libelf_ar.o".
Obtained from: elftoolchain
MFC after: 1 month
favour of `elf_getshdrnum()`, `elf_getphdrnum()` and `elf_getshdrstrndx()`
respectively.
* Add new manual pages for `elf_getshdrstrndx()`, `elf_getphdrnum()` and
`elf_getshdrnum()`.
* Add a deprecation warning for `elf_getshstrndx()`, `elf_getphnum()` and
`elf_getshnum()`.
Obtained from: elftoolchain
MFC after: 1 month
types that don't have a fixed size.
- The *fsize() functions should return a size of 1, for variable length
types.
- Redefine symbol ELF_T_LAST to match the current end of the list.
Obtained from: elftoolchain
MFC after: 1 month
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
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
- elf_getdata() and elf_rawdata() should return an "Elf_Data" structure
that has its "d_buf" member set to NULL and "d_size" member set to
the nominal 'size' of the section. [1]
- Update the manual page for these functions.
- Fix a memory leak in an error handling path inside elf_getdata().
- Use _libelf_allocate_data() in elf_newdata() for consistency.
Obtained from: elftoolchain
MFC after: 1 month
use of `elf_getbase()` on non-archive members. This change is needed
for gcc LTO (-flto) to work properly.
* Style fix: paranthesize returned values.
* Document the current behaviour of `elf_getbase()`.
Tested by: gerald, Steve Kargl (original patch)
Obtained from: elftoolchain
MFC after: 3 days
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.
Reviewed by: ru
Approved by: philip, ed (mentors)
Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and
lower it when needed.
I'm setting WARNS?=0 for secure/. It seems secure/ includes the
Makefile.inc provided by lib/. I'm not going to touch that directory.
Most of the code there is contributed anyway.
section header entry if the application is not taking charge of ELF
object layout.
Update (c) years, and bump the manual page's date.
Submitted by: kaiw
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]
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)
- Correctly retrieve the initial (special) members of an archive after
an archive descriptor is rewound using elf_rand(SARMAG).
- Do not strip trailing white space from the 'raw' names retrieved
using elf_getarhdr().
Reported by: "Hyo geol, Lee" <hyogeollee at gmail dot com>
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]
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
- 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.