summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_getabbrev.c
Commit message (Collapse)AuthorAgeFilesLines
* libdw: Check end of attributes list consistently.Mark Wielaard2018-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | dwarf_child (__libdw_find_attr), dwarf_getabbrevattr[_data] and dwarf_getattrs all assume the end of the attribute list is when both the name (code) and form of the attribute are zero. dwarf_getabbrev (__libdw_getabbrev) and dwarf_hasattr assume the end of the attribute list is when either the name (code) or the form of the attribute is zero. The DWARF spec says: "The series of attribute specifications ends with an entry containing 0 for the name and 0 for the form." So the first check is correct. Make sure dwarf_getabbrev and dwarf_hasattr use the same check. This is important since all other functions expect dwarf_getabbrev (__libdw_getabbrev) to have done a data sanity check of the attribute. So if the ending condition is different it could cause a crash. https://sourceware.org/bugzilla/show_bug.cgi?id=23529 Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Check validity of dwarf_getabbrev arguments.Mark Wielaard2018-06-111-3/+17
| | | | | | | When the given Dwarf_Die was invalid we might crash and when the offset was totally bogus we might succeed with a random abbrev. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle DWARF5 DW_FORM_implicit_const. Add dwarf_getabbrevattr_data.Mark Wielaard2018-02-211-0/+7
| | | | | | | | | | Handle the new DW_FORM_implicit_const. The value of this form is embedded in the abbrev data (as sleb128) and not in the info DIE data. This also adds a new function dwarf_getabbrevattr_data which allows getting any data/value associated with a form. eu-readelf will use this new function to show the DW_FORM_implicit_const value. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Reduce size of struct Dwarf_Abbrev.Mark Wielaard2018-01-011-4/+3
| | | | | | | | If we don't cache the attrcnt and use bitfields for the has_children and code we can reduce the size of struct Dwarf Abbrev from 32 to 24 bytes on 64bit architectures and from 28 to 20 bytes on 32bit arches. Signed-off-by: Mark Wielaard <[email protected]>
* Remove old-style function definitions.Mark Wielaard2015-09-231-10/+3
| | | | | | | We already require -std=gnu99 and old-style function definitions might hide some compiler warnings. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Add get_uleb128 and get_sleb128 bounds checking.Mark Wielaard2014-12-171-4/+15
| | | | | | | | | | | 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]>
* libdw: Don't assert in __libdw_getabbrev when seeing bad DWARF.Mark Wielaard2014-11-261-3/+8
| | | | 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]>
* merge of 67f3844b544f03a64b3ac896c19f94744923d76aUlrich Drepper2006-07-121-2/+2
| | | | and ba017f6b59b4ad649cf32f4eefdfecca8b31332c
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-07-121-2/+2
| | | | | | e5cfdd13aa39dfae16b905fd57ff56ad8a131bb5) to branch 'com.redhat.elfutils' (head 60222fc1981540f15e674b6705fd7a6f628f95a4)
* Adjust for internal_function_def removal.Ulrich Drepper2006-07-121-2/+2
|
* 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-9/+45
| | | | | | 4f8fc821345feef58624f0aa5b470d4827577d8c) to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
* 2005-08-01 Roland McGrath <[email protected]>Roland McGrath2005-08-021-0/+7
| | | | | | * dwarf_getaranges.c (dwarf_getaranges): Check for bogus offset. * dwarf_getabbrev.c (__libdw_getabbrev): Likewise.
* Adjust for monotone.Ulrich Drepper2005-07-261-0/+127