summaryrefslogtreecommitdiffstats
path: root/libdw/cfi.c
Commit message (Collapse)AuthorAgeFilesLines
* Use fallthrough attribute.Joshua Watt2018-02-101-2/+2
| | | | | | | | | | | | | | | Use __attribute__ ((fallthrough)) to indicate switch case fall through instead of a comment. This ensures that the fallthrough warning is not triggered even if the file is pre-processed (hence stripping the comments) before it is compiled. The actual fallback implementation is hidden behind a FALLBACK macro in case the compiler doesn't support it. Finally, the -Wimplict-fallthrough warning was upgraded to only allow the attribute to satisfy it; a comment alone is no longer sufficient. Signed-off-by: Joshua Watt <[email protected]>
* Add GCC7 -Wimplicit-fallthrough support/fixes.Mark Wielaard2016-11-101-0/+2
| | | | | | | | | | | 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 <[email protected]>
* Move nested functions in libdw/cfi.c to file scope.Chih-Hung Hsieh2015-10-221-42/+45
| | | | | | * No nested functions to compile with clang/llvm. Signed-off-by: Chih-Hung Hsieh <[email protected]>
* libdw: Check register number in CFI isn't insanely large.Mark Wielaard2015-01-151-1/+10
| | | | | | | | | | Some cfi.c array size allocation calculations might overflow when trying to accommodate insanely large number of registers. Don't allow register numbers larger than INT32_MAX / sizeof (dwarf_frame_register). Found by afl-fuzz. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Add get_uleb128 and get_sleb128 bounds checking.Mark Wielaard2014-12-171-29/+40
| | | | | | | | | | | 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 <[email protected]>
* backends: ppc_abi_cfi reg1 use DW_CFA_val_offset not DW_CFA_val_expression.Mark Wielaard2013-10-071-0/+4
| | | | | | | | | | | | | | | Register rules using expressions are stored using an offset from the start of the .eh_frame or .debug_frame ELF section data. Since abi_cfi rules aren't stored in those ELF sections they should use neither DW_CFA_expression nor DW_CFA_val_expression. The only backend that used DW_CFA_val_expression was ppc_cfi.c. It was easier to express the same rule using DW_CFA_val_offset than to change the code to handle register rules using expressions. On most architectures this did work by accident. See the definition of struct dwarf_frame_register value in libdw/cfi.h to see why. But on ia64 the abi_cfi data and actual frame data were placed too far apart and caused a crash in tests/run-addrcfi.sh for ppc32. Signed-off-by: Mark Wielaard <[email protected]>
* lib/Jan Kratochvil2012-10-081-0/+4
| | | | | | | | | | system.h (eu_static_assert): New macro. libdw/ cfi.c: New include system.h. (execute_cfi) (enough_registers): Clear new memory after realloc. Signed-off-by: Jan Kratochvil <[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]>
* Back out dwarf_cfi_validate_fde.Roland McGrath2010-06-231-39/+0
|
* Add new dwarf_cfi_validate_fde call.Roland McGrath2010-06-161-0/+39
|
* Check for CIE initial instructions that bogusly change the PC.Roland McGrath2010-06-161-0/+1
|
* libdw: Record ill-specified CFA rule and diagnose in dwarf_frame_cfa, not ↵Roland McGrath2010-04-261-2/+8
| | | | immediately at decode time.
* Revert "Handle partial-reset DW_CFA_def_cfa_* operations after ↵Roland McGrath2010-04-261-26/+12
| | | | | | | | DW_CFA_def_cfa_expression." This reverts commit 3b2486c20c147b420b37a2f610912547b482ee1d. What GCC emits really is bogus.
* Handle partial-reset DW_CFA_def_cfa_* operations after ↵Roland McGrath2010-04-221-12/+26
| | | | DW_CFA_def_cfa_expression.
* Fix double-free in libdw CFI handling error paths.Roland McGrath2010-04-221-19/+18
|
* CFI support: lookup by PC and translate into DWARF location per registerRoland McGrath2009-07-081-0/+500