summaryrefslogtreecommitdiffstats
path: root/libdw/libdw_findcu.c
Commit message (Collapse)AuthorAgeFilesLines
* libdw: Add explicit section index to struct Dwarf_CUUlf Hermann2017-12-211-2/+3
| | | | | | | | | | | | | | | | The DIE (attribute) data might come from either the main .debug_info section or for DWARFv4 from a separate .debug_types section. Or in case of the fake_loc_cu from the .debug_loc section and in the case of macros from the .debug_macinfo or .debug_macro section. We didn't handle the last two "fake" CU cases correctly when sanity checking offsets in __libdw_read_address and __libdw_read_offset. Add an explicit sec_idx field to struct Dwarf_CU that is always set to the actual section that the data came from. Change-Id: I83260622b55d3778a38cd46427dba158d186c51e Reviewed-by: Christian Kandeler <[email protected]>
* Properly mark all internal function definitions.Mark Wielaard2015-09-231-0/+1
| | | | | | | | | | | | | | | | | Since we banned old style function definitions GCC is able to diagnose function definitions that don't match the function declaration: elf32_getehdr.c:78: error: conflicting types for ‘__elf64_getehdr_wrlock’ libelfP.h:498: note: previous declaration of ‘__elf64_getehdr_wrlock’ This happens on i386 because there internal functions are marked with: # define internal_function __attribute__ ((regparm (3), stdcall)) Make sure all internal function declarations and definitions are marked with internal_function. Signed-off-by: Mark Wielaard <[email protected]>
* Replace some K&R function definitions with ansi-C definitions.Chih-Hung Hsieh2015-09-071-7/+2
| | | | | Signed-off-by: Chih-Hung Hsieh <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Make sure all attributes come with a (fake) CU for bound checks.Mark Wielaard2014-12-171-3/+2
| | | | | | | | | | All attributes now have a reference to a (fake) CU that has startp and endp set to the data section where the form data comes from. Use that for bounds checking in __libdw_form_val_len and dwarf_formblock to make sure data read doesn't overflow any data section. Remove libdwP.h cu_data and use cu startp and endp directly where appropriate. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Make sure end of next cu doesn't overflow section data size.Mark Wielaard2014-12-161-0/+6
| | | | | | | An invalid or trucated debug info/type section could cause the cu endp to point beyond the end of section data. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: save startp/endp boundaries in Dwarf_CUJosh Stone2014-12-111-1/+5
| | | | | | | Rather than looking up section data every time, we can simply save the range of each CU as pointers in Dwarf_CU. Signed-off-by: Josh Stone <[email protected]>
* libdw: Make sure that every debug_types sig8 is hashedJosh Stone2013-10-031-0/+3
| | | | | | | | | | | | When dwarf_formref_die can't find a sig8 in the hash, it walks __libdw_intern_next_unit, and was then adding those to the hash. However, if dwarf_offdie_types is called earlier, which also uses that next_unit, then they are missed from the hash (and never revisited). This patch makes __libdw_intern_next_unit do the sig8 hash insert, so no type unit is ever missed. Signed-off-by: Josh Stone <[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 bug using dwarf_next_unit to iterate over .debug_typesTom Tromey2012-03-211-35/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | * libdw_findcu.c (findcu_cb): Move earlier. (__libdw_intern_next_unit): Add new CU to search tree here... (__libdw_findcu): ... not here. * typeiter.c: New file. * run-typeiter.sh: New file. * testfile59.bz2: New file. * Makefile.am (noinst_PROGRAMS): Add typeiter. (TESTS): Add run-typeiter.sh. (EXTRA_DIST): Add run-typeiter.sh, testfile59.bz2. (typeiter_LDADD): New variable. If you call dwarf_next_unit to iterate over .debug_types, then call dwarf_offdie_types, you can see a failure if some earlier call happened to call __libdw_intern_next_unit via dwarf_formref_die. What happens is that __libdw_intern_next_unit updates the Dwarf's next_tu_offset, but does not add the TU to the TU search tree. So, the call to dwarf_offdie_types does not find the TU in the tree, and will not search any more, causing a failure. This fix changes __libdw_intern_next_unit to add the TU to the search tree, rather than relying on __libdw_findcu to do it.
* Finish .debug_types support in libdw and readelf.Roland McGrath2010-06-201-8/+13
|
* Handle reading .debug_types section.Roland McGrath2010-06-161-34/+55
|
* Handle DWARF version 4 CUs.Roland McGrath2010-06-011-3/+3
|
* 2007-10-23 Roland McGrath <[email protected]>Roland McGrath2007-10-231-1/+12
| | | | | | * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel module to appear first.
* 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)
* Adjust for monotone.Ulrich Drepper2005-07-261-0/+110