summaryrefslogtreecommitdiff
path: root/libdw/encoded-value.h
Commit message (Collapse)AuthorAgeFilesLines
* Add GCC7 -Wimplicit-fallthrough support/fixes.Mark Wielaard2016-11-101-0/+1
| | | | | | | | | | | GCC7 will have a new -Wimplicit-fallthrough warning. It did catch one small buglet in elflint option procession. So it seems useful to enable to make sure all swatch case fallthroughs are deliberate. Add configure check to detect whether gcc support -Wimplicit-fallthrough and enable it. Add fixes and explicit fallthrough comments where necessary. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Fix overflow in read_encoded_value for the DW_EH_PE_indirect case.Mark Wielaard2015-06-011-3/+4
| | | | | | | If we are going to dereference a pointer there should be at least enough data to hold a pointer. Found by afl-fuzz. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: ensure read_encoded_value's value is setJosh Stone2015-02-111-1/+1
| | | | | | | | | | | | With CFLAGS='-Og -g', F21 gcc hits -Werror=maybe-uninitialized in read_encoded_value at "*result += value". It's fine with -O2/-O0. In particular it seems to care about the __libdw_cfi_read_address_inc calls. By my inspection, the only way those don't set value are for error cases, which will then return immediately. This patch just sets value = 0 to begin with, so gcc is always convinced it's fine. Signed-off-by: Josh Stone <jistone@redhat.com>
* libdw: Robustify eh_frame_hdr and encoded-values reading.Mark Wielaard2015-01-151-18/+51
| | | | | | | | | Sanity check and keep track of binary_search_table data buffer length. Add bounds check to encoded value reading. Also fix a bug when reading the eh_frame header data from an other endian ELF image. Add a testcase that would fail the new sanity checks because of the endian bug. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Add get_uleb128 and get_sleb128 bounds checking.Mark Wielaard2014-12-171-3/+5
| | | | | | | | | | | Both get_uleb128 and get_sleb128 now take an end pointer to prevent reading too much data. Adjust all callers to provide the end pointer. There are still two exceptions. "Raw" dwarf_getabbrevattr and read_encoded_valued don't have a end pointer associated yet. They will have to be provided in the future. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* 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 <rfontana@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix some corners of DW_EH_PE_* handling.Roland McGrath2010-06-161-9/+23
|
* CFI support: lookup by PC and translate into DWARF location per registerRoland McGrath2009-07-081-0/+202