summaryrefslogtreecommitdiffstats
path: root/libelf/elf_getdata.c
Commit message (Collapse)AuthorAgeFilesLines
* libelf: Add elf_compress and elf_compress_gnu.Mark Wielaard2015-11-021-11/+25
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* Remove old-style function definitions.Mark Wielaard2015-09-231-6/+2
| | | | | | | We already require -std=gnu99 and old-style function definitions might hide some compiler warnings. Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Make sure elf_getdata_rawchunk returns aligned data.Mark Wielaard2015-06-091-0/+9
| | | | | | | | | | elf_getdata_rawchunk might return an unaligned buffer for the requested ELF data type. Make sure the data is also correctly aligned when using an mmapped file. Also add some missing alignments for ELF data types for __libelf_type_align (the missing types could also make elf_getdata to return unaligned data). Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Make sure conversion functions work on aligned data for type.Mark Wielaard2015-06-091-2/+24
| | | | | | | | | | | The gelf_xlate conversion functions work on properly aligned ELF data types. If elf_get data needs to do conversion and ! ALLOW_UNALIGNED and the rawdata_base isn't aligned properly for the section type, then provide an aligned copy of the data. Found with --enable-sanitize-undefined in run-test-archive64.sh on x86_64. Signed-off-by: Mark Wielaard <[email protected]>
* libelf: More checking of valid sh_addralign values.Mark Wielaard2015-05-181-0/+14
| | | | | | | | | | | | | | | | | | | | There were two issues with bogus sh_addralign values. First we would only check the individual Elf_Data d_align values were powerof2. But not the actual shdr addralign value. This would cause an issue if the shdr addralign was bigger than all of the individual d_align values. Then we could write out a bogus (! powerof2) shdr addralign value for the sections. Secondly when reading in the Elf_Data we would set the d_align value to the value of the shdr addralign value. But we would not check it was valid at all. In practice there are ELF files with incorrect sh_addralign values (they are a powerof2, but aren't aligned to the ELF image offset). We would try to fix that up in elf_update by adding extra padding. But this could bloat the ELF image a lot for large alignment values. So for too large alignments that are bigger than the offset in the ELF file clamp them to the offset value. This could lead us to reject to write out the data again when the offset was not a powerof2. But this will only happen for aligment values bigger than 64. Which are uncommon in practice. Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Fix elf_newdata when raw ELF file/image data is available.Mark Wielaard2015-02-061-35/+41
| | | | | | | | | | | | | | | When ELF data for a section has been read by elf_rawdata, data_read and rawdata_base are set, but data_list_rear will not be set until the data will be converted (by elf_getdata). elf_newdata would overwrite the existing data in that case. Both elf_getdata and elf_update rely on the fact that when data_list_rear is set they don't have to look at the raw data anymore. So make sure we update the data list properly before adding any new data and raw data is available in elf_newdata. Add newdata test that calls elf_newdata before and after elf_rawdata and elf_getdata and checks the new size and contents of the section. Signed-off-by: Mark Wielaard <[email protected]>
* libelf: getdata check 64bit values correctly on 32bit arch.Mark Wielaard2014-11-161-3/+3
| | | | | | | | On 32bit arches size_t is too small to do size and overflow checks of 64bit ELF files. Use the actual Elf64 types to make sure checks on 64bit ELF files are done correctly on 32bit arches. Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Fix unsigned overflow check in elf_getdata.Mark Wielaard2014-11-131-3/+2
|
* libelf: Correct shdr size check for (raw) getdata.Mark Wielaard2014-11-081-2/+5
| | | | | Reported-by: Hanno Böck <[email protected]> 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 for the samePetr Machata2010-04-061-3/+6
| | | | * Initialize data.s for data that do not need a conversion.
* propagate from branch 'com.redhat.elfutils.roland.pending.libelf-threads' ↵Ulrich Drepper2008-12-041-8/+21
| | | | | | (head fc97c9c202b5d7d7699a3b1d5c53007a2ef37bb1) to branch 'com.redhat.elfutils' (head 67cccb9bfffc1a7fe3d8d355a2d9b6d0e489ff81)
* Fix up bogon and missing log entries from .pmachata.threads branch.Roland McGrath2008-08-251-16/+33
|
* propagate from branch 'com.redhat.elfutils.pmachata.threads' (head ↵Ulrich Drepper2008-08-161-15/+28
| | | | | | 8bd3bc10eb015c96f7bafcc6a22c973620b57dd8) to branch 'com.redhat.elfutils' (head c5a11b6b3329382f1b5ffd0020f0d93c64176f20)
* 2007-09-27 Roland McGrath <[email protected]>Roland McGrath2007-09-271-1/+3
| | | | | | | | | | | | * alpha_retval.c: Use dwarf_attr_integrate and dwarf_hasattr_integrate. * i386_retval.c: Likewise. * ia64_retval.c: Likewise. * ppc64_retval.c: Likewise. * ppc_retval.c: Likewise. * s390_retval.c: Likewise. * sparc_retval.c: Likewise. * x86_64_retval.c: Likewise.
* Remove bogon leaked from other branch.elfutils-0.127Roland McGrath2007-04-191-1/+0
|
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2007-03-301-98/+63
| | | | | | b584b7056d679db0fc272b47667047d07737ca55) to branch 'com.redhat.elfutils' (head 5f150a0b2f07e8c60913d4e6ad833ef026ccd26e)
* merge of 67f3844b544f03a64b3ac896c19f94744923d76aUlrich Drepper2006-07-121-1/+1
| | | | and ba017f6b59b4ad649cf32f4eefdfecca8b31332c
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-07-121-1/+1
| | | | | | e5cfdd13aa39dfae16b905fd57ff56ad8a131bb5) to branch 'com.redhat.elfutils' (head 60222fc1981540f15e674b6705fd7a6f628f95a4)
* Adjust for internal_function_def removal.Ulrich Drepper2006-07-121-1/+1
|
* Adjust for final version of GNU-style hash table format.Ulrich Drepper2006-07-121-8/+12
|
* 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-12/+45
| | | | | | 4f8fc821345feef58624f0aa5b470d4827577d8c) to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
* merge of 333c187506c852455e9f7be44fa9adc360416217Ulrich Drepper2005-08-291-5/+8
| | | | and 79955b942e3f0ddc71117feea5754df61edcc42a
* 2005-08-24 Roland McGrath <[email protected]>Roland McGrath2005-08-251-8/+5
| | | | | * line2addr.c (print_address): Omit () for DSOs.
* Fix more EINTR handling problems. Add jump prediction.Ulrich Drepper2005-08-291-5/+8
|
* Adjust for monotone.Ulrich Drepper2005-07-261-0/+454