summaryrefslogtreecommitdiffstats
path: root/libelf
Commit message (Collapse)AuthorAgeFilesLines
...
* libelf: Fix handling of (extended) phnum.Mark Wielaard2014-11-173-7/+24
| | | | | | | | If there is no e_phoff e_phnum cannot be trusted. Extended phnum can only be gotten if we have an actual section table and a shdr for section zero, Extended phnum can be too large to fit in the file (or a size_t). Signed-off-by: Mark Wielaard <[email protected]>
* gelf_getnote: Check padding overflow.Mark Wielaard2014-11-162-2/+11
| | | | | | | Since ELF notes need to be properly aligned they can include padding. Make sure the padding itself and the padding calculation doesn't overflow. Signed-off-by: Mark Wielaard <[email protected]>
* libelf: getdata check 64bit values correctly on 32bit arch.Mark Wielaard2014-11-162-3/+8
| | | | | | | | 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: gelf_getnote check for offset overflow.Mark Wielaard2014-11-142-2/+7
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Fix unsigned overflow check in elf_getdata.Mark Wielaard2014-11-132-3/+7
|
* libelf: Use mempcpy not __mempcpy.Mark Wielaard2014-11-132-2/+6
| | | | | | | We were using mempcpy everywhere else, only __libelf_next_arhdr_wrlock used __mempcpy. Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Correct shdr size check for (raw) getdata.Mark Wielaard2014-11-083-6/+15
| | | | | Reported-by: Hanno Böck <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* elf_begin sets elf_errno for cases that the file is completely unreadablePetr Machata2014-09-112-3/+11
| | | | | | | | | | | | | | - The problem this is trying to solve can be seen for example thus: $ eu-readelf -a / eu-readelf: failed reading '/': (null) With the fix we see a proper error number and get a reasonable error message: $ eu-readelf -a / eu-readelf: failed reading '/': invalid file descriptor Signed-off-by: Petr Machata <[email protected]>
* Update elf.h from glibc.Mark Wielaard2014-07-042-1/+33
| | | | | | | Includes new bits needed for ppc64le ELFv2 abi. https://bugzilla.redhat.com/show_bug.cgi?id=1110249 Signed-off-by: Mark Wielaard <[email protected]>
* Remove mudflap build option.Mark Wielaard2014-04-184-14/+8
| | | | | | | | | The --enable-mudflap configure build has been broken for 2 years without anybody apparently noticing. GCC 4.9 removed mudflap support. Before release we now run make distcheck with valgrind support. Removal of the mudflap configure option simplifies the build a little. Signed-off-by: Mark Wielaard <[email protected]>
* robustify: libelf gelf define INVALID_NDX macro.Jakub Jelinek2014-01-2320-103/+74
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* robustify: libelf.Jakub Jelinek2014-01-239-18/+139
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Only memcpy ehdr back when not already directly mmapped.Mark Wielaard2013-11-112-1/+6
| | | | | | | | | | When the elf file is mmapped ehdr can still point to ehdr_mem if the address is unaligned. In such cases we do need to memcpy the ehdr back to the file. We shouldn't when ehdr already comes directly from the mmapped file, because that would cause an memcpy call with overlapping addresses (ehdr being copied directly over itself). Signed-off-by: Mark Wielaard <[email protected]>
* libelf: Write all section headers if elf flags contains ELF_F_DIRTY.Mark Wielaard2013-11-052-2/+9
| | | | | | | | | When ehdr e_shoff changes, elf flags is set dirty. This indicates that the section header moved because sections were added/removed or changed in size. Reported-by: Jiri Slaby <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Check for prefixed ar, readelf, and nmMichael Forney2013-11-052-1/+5
| | | | | | | | Sometimes with cross-compile toolchains, the tools are prefixed with the target arch. Using AC_CHECK_TOOL looks for tools named like this. Signed-off-by: Michael Forney <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Update elf.h from glibcPetr Machata2013-10-012-2/+154
| | | | Signed-off-by: Petr Machata <[email protected]>
* Update elf.h from glibcPetr Machata2013-09-262-111/+261
| | | | Signed-off-by: Petr Machata <[email protected]>
* gelf.h: Fix typo in comment.Namhyung Kim2013-08-282-1/+5
| | | | | Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* gelf_getauxv: Add missing whitespace.Mark Wielaard2013-08-282-2/+6
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* gelf_getauxv: Remove unnecessary casts to char *.Mark Wielaard2013-08-272-1/+5
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* gelf_getauxv: Use memcpy, not pointer deref, to avoid alignment problems.Kurt Roeckx2013-08-262-1/+7
| | | | | Signed-off-by: Kurt Roeckx <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* elf_getarsym: Handle unaligned data in archive index.Roland McGrath2013-01-072-0/+6
|
* elf_getarsym: Use memcpy instead of pointer dereference so as not to assume ↵Roland McGrath2013-01-072-1/+8
| | | | | | the field is naturally aligned. Signed-off-by: Roland McGrath <[email protected]>
* Update elf.h from glibc.Petr Machata2012-09-172-0/+16
| | | | Signed-off-by: Petr Machata <[email protected]>
* Update elf.h from glibc.Roland McGrath2012-08-162-23/+257
| | | | Signed-off-by: Roland McGrath <[email protected]>
* elf32_checksum.c: Removed unused ebl_debugscn_p define and confusing comment.Mark Wielaard2012-08-142-5/+5
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* Implement support for archives with 64-bit symbol tablePetr Machata2012-08-073-43/+98
| | | | Signed-off-by: Petr Machata <[email protected]>
* elf_getshdr should work for elf->flags & ELF_F_MALLOCED.Mark Wielaard2012-07-242-4/+12
| | | | | Reported-by: Nick Alcock <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* elf*_xlatetom: do not check ELF_T_NHDR has integer number of recordsPetr Machata2012-07-172-2/+11
| | | | | | | See this bug report for more details: https://bugzilla.redhat.com/show_bug.cgi?id=835877 Signed-off-by: Petr Machata <[email protected]>
* Update name, license and contributor policy.Mark Wielaard2012-06-05125-4975/+2375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* Remove .mtn-ignore and .cvsignore files.Mark Wielaard2012-06-051-1/+0
| | | | We use .gitignore these days.
* elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET.Mark Wielaard2012-04-022-1/+7
| | | | | | readelf -d doesn't work if a SHT_NOBITS section is right before the actual .dynamic section at the same offset. elflint also fails on such binaries. So skip SHT_NOBITS sections at the same offset in [g]elf[32|64]_offscn().
* Don't exclude sh_type >= SHT_NUM from stripping.Roland McGrath2012-03-222-5/+6
|
* elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.Mark Wielaard2012-02-262-0/+5
| | | | Reported-by: Kurt Roeckx <[email protected]>
* Fix doubled words.Marek Polacek2011-04-161-1/+1
|
* Fix off64_t overflow when MAXIMUM_SIZE == ~0.Jan Kratochvil2011-01-052-2/+7
|
* Add missing size entries for ELF_T_LIB and ELF_T_GNUHASH.Roland McGrath2010-08-183-4/+17
|
* Implicitly set dirty bitUlrich Drepper2010-06-144-3/+18
| | | | | | | | The gelf_update_[eps]hdr functions didn't implicitly mark the data structures as modified. This has always been the case and programs should set the bit but it is somewhat inconsistent since other update functions implicitly set the bit. Do it in these three cases, too.
* Fix typo in last change.Roland McGrath2010-04-141-1/+1
|
* Handle truncated phdrs without crash.Roland McGrath2010-04-143-10/+18
|
* Update elf.h from glibc.Roland McGrath2010-04-132-2/+3
|
* Complete SH port.Matt Fleming2010-04-102-0/+28
|
* Fix some message typos and xgettext markers.Roland McGrath2010-04-062-3/+8
|
* Fix for the samePetr Machata2010-04-062-3/+11
| | | | * Initialize data.s for data that do not need a conversion.
* elf.h: Update from glibc.Roland McGrath2010-03-112-1/+11
|
* Update elf.hUlrich Drepper2010-03-042-2/+38
|
* Avoid wild section data pointers from bogus sh_offset in mapped files.Roland McGrath2010-02-172-8/+20
|
* Clean up and consolidate automake magic to reduce duplication and to work ↵Roland McGrath2010-02-152-22/+6
| | | | with --disable-dependency-tracking.
* Add elf_getphdrnum, support >65536 phdrs.Roland McGrath2010-01-0714-47/+264
|
* Fix fill_mmap for sections past the section headersLubomir Rintel2010-01-042-2/+10
| | | | | | | | | | If fill_mmap() was run for a section that's past the shdr_end, but does not immediately follow the section headers the fill start would be determined incorrectly as shdr_end, which would wipe off contents of sections between shdr_end and current one. Issue was reported and triaged by Hugo Mildenberger, Graham Murray and Peter Alfredsen. (http://bugs.gentoo.org/show_bug.cgi?id=288977)