summaryrefslogtreecommitdiffstats
path: root/libdwfl/elf-from-memory.c
Commit message (Collapse)AuthorAgeFilesLines
* libdwfl: Document core memory and remote memory ELF shdrs reading.Mark Wielaard2018-09-141-0/+6
| | | | | | | | | There are two places, dwfl_segment_report_module and elf_from_remote_memory in libdwfl where we use the Ehdr e_shnum directly. Document why this is fine. Getting the shdrs in those two places is really just a nice bonus and if there are more than 0xff00 then it is unlikely we will get them all anyway. Signed-off-by: Mark Wielaard <[email protected]>
* Avoid signed/unsigned comparisonUlf Hermann2017-04-271-1/+1
| | | | | | | | | | | Some compilers implicitly cast the result of uint_fast16_t * uint_fast16_t to something signed and then complain about the comparison to (unsigned) size_t. Casting phnum to size_t is a good idea anyway as 16bit multiplication can easily overflow and we are not checking for this. Signed-off-by: Ulf Hermann <[email protected]>
* Allocate exact amount of bytes for phdrs and shdrs.Mark Wielaard2015-10-081-10/+6
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* Do without union of variable length arrays.Chih-Hung Hsieh2015-10-071-23/+30
| | | | | | | | | | | | | | Prepare to compile with clang. A union like { T32 a32[n]; T64 a64[n]; } u; is expanded to size_t nbytes = n * MAX(sizeof(T32), sizeof(T64)); void *data = malloc(nbytes); T32 (*a32)[n] = data; T64 (*a64)[n] = data; Signed-off-by: Chih-Hung Hsieh <[email protected]>
* libdwfl: Don't allocate all phdrs on the stack in elf_from_remote_memory.Mark Wielaard2015-05-271-19/+40
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Remove p_align sanity check from elf_from_memory.Mark Wielaard2014-12-191-9/+5
| | | | | | | | | | | | In commit f15bcd "elf_from_remote_memory should use pagesize, not p_align" we already relaxed the p_align sanity check to allow alignment of the segment against the pagesize since that is what the glibc dynamic linker actually does. But on some architectures the kernel inserts a vdso with a completely bogus p_align for some PT_LOAD segments. So just drop the whole sanity check and allow anything since we won't use p_align, but always already use pagesize anyway. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: elf_from_remote_memory only trust shdrs of last file-only segment.Mark Wielaard2014-03-171-5/+12
| | | | | | | | | If the last PT_LOAD segment that contains the whole shdrs also extends the segment in memory beyond the end of file the program might be reusing the memory space that we expect the shdrs to be in. Don't trust the shdrs are valid in that case. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: elf_from_remote_memory should use pagesize, not p_align.Mark Wielaard2014-03-101-17/+37
| | | | | | | | | | elf_from_remote_memory would use the actual p_align of the PT_LOAD segments to calculate the loadbase, end and start of a segment. But the dynamic loader aligns the segments using the pagesize and only sanity checks the p_align values. So we should do the same to get accurate segment addresses. Also fixes a small memory leak in case the ELF image appears to be bad. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: elf-from-memory.c (elf_from_remote_memory): Check against p64 p_type.Mark Wielaard2014-02-261-1/+1
| | | | | | | There was a type in the case of parsing ELFCLASS64 phdrs. Check against p64 p_type, not the p32 p_type which at a different location in the union. Signed-off-by: Mark Wielaard <[email protected]>
* Update name, license and contributor policy.Mark Wielaard2012-06-051-40/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change name from "Red Hat elfutils" to "elfutils". * Update license of standalone tools and test from GPLv2 to GPLv3+. * Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+. * Add Developer Certificate of Origin based contributor policy. top-level: - COPYING: Upgraded from GPLv2 to GPLv3. - CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files. - NEWS: Added note about new contribution and license policy. - Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST. - configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'. backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf: - All files updated to GPLv2/LGPLv3+. Except some very small files (<5 lines) which didn't have any headers at all before, the linker .maps files and the libcpu/defs files which only contain data and libelf/elf.h which comes from glibc and is under LGPLv2+. config: - elfutils.spec.in: Add new License: headers and new %doc files. - Update all license headers to GPLv2/LGPLv3+ for files used by libs. src, tests: - All files updated to GPLv3+. Except for the test bz2 data files, the linker maps and script files and some very small files (<5 lines) that don't have any headers. Signed-off-by: Richard Fontana <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Fix elf_from_remote_memory for ELFCLASS64 case.Roland McGrath2011-12-021-4/+4
|
* missed testdata filesRoland McGrath2007-08-131-2/+6
|
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2007-03-131-2/+2
| | | | | | e0c7abd450c9e49093cfae30af8a22782a74a403) to branch 'com.redhat.elfutils' (head 2c784d50eee72e33972c333138a3a28df304da63)
* merge of b305fe132f91c44a41a877a48efc3bdfda785b73Ulrich Drepper2006-06-151-3/+3
| | | | and c4704f02db5f42d7bcdb2feafc6199d7ac132da3
* (create_verneed_data): Pretty printing.Ulrich Drepper2006-06-121-3/+3
|
* 2006-06-13 Roland McGrath <[email protected]>Roland McGrath2006-06-131-3/+3
| | | | | | * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo. Use __libdwfl_seterrno for elf_memory failure.
* Fix FSF address. No exception for libdwarf.Ulrich Drepper2006-04-041-1/+1
|
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-04-041-10/+46
| | | | | | 4f8fc821345feef58624f0aa5b470d4827577d8c) to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
* Adjust for monotone.Ulrich Drepper2005-07-261-0/+328