summaryrefslogtreecommitdiffstats
path: root/libdwfl/dwfl_module.c
Commit message (Collapse)AuthorAgeFilesLines
* libdw: Cache ELF directory early. Explicitly set it in dwfl.Mark Wielaard2018-05-201-0/+1
| | | | | | | | | | | The logic that finds alt files and dwo files relies on having an open file descriptor. But after all needed ELF data has been read the underlying Elf file descriptor can be closed. libdwfl in particular closes file descriptor fairly aggressively. So capture the directory early on. And make dwfl set it if it has recorded it. Which it will do now before closing a file descriptor for the main Dwfl_Module file. Signed-off-by: Mark Wielaard <[email protected]>
* Avoid double-including config.hUlf Hermann2017-05-021-0/+4
| | | | | | | | | | | | | | | | config.h doesn't have include guards, so including it twice is bad. We deal with this by checking for PACKAGE_NAME, but only in some places. Once we start using gnulib, we will need to include config.h before any gnulib-generated headers. This is problematic if we include it transitively through our own private headers. In order to set a clear rule about inclusion of config.h, it is now included in every .c file as first header, but not in any header. This will definitely avoid double-inclusion and satisfy the condition that it has to be included before gnulib headers. It comes at the price of adding some redundancy, but there is no clean way to avoid this. Signed-off-by: Ulf Hermann <[email protected]>
* libdw: Make sure Ebl is always freed from cfi frame cache.Mark Wielaard2015-11-271-4/+19
| | | | | | | | | | | | | | libdwfl sets the Dwfl_Module Ebl for the eh_cfi and dwarf_cfi cache to save a bit of memory. It also calls ebl_closebackend on the ebl to free it. The Dwarf_CFI never frees the Ebl in the cache, even when it opened one itself. This means that if only libdw calls are used to access the Dwarf_CFI the Ebl might be leaked. Always destroy the Dwarf_CFI cache Ebl in __libdw_destroy_frame_cache. And in __libdwfl_module_free clear the Dwarf_CFI Ebl if it is the Dwfl_Module Ebl before calling dwarf_cfi_end and dwarf_end. Signed-off-by: Mark Wielaard <[email protected]>
* Move nested functions in dwfl_module.cChih-Hung Hsieh2015-11-031-16/+17
| | | | | | | | * Nested functions in this file are moved to file scope to compile with clang. Extra parameters are added to pass local variables. Signed-off-by: Chih-Hung Hsieh <[email protected]>
* libdwfl: Move dwz alt multi file searching to find_debuginfo callback.Mark Wielaard2014-05-021-2/+12
| | | | | | | | | | Don't hard code the Dwarf dwz alt multi file search but allow the user to override it through the standard Dwfl_Callbacks. Also move ownership completely to the user of dwarf_setalt by removing free_alt from Dwarf and adding alt, fd and elf fields to Dwfl_Module. Add a relative .dwz file test case. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Fix various frame related memory leaks.Mark Wielaard2013-12-161-0/+6
| | | | | | | | | | The result of dwarf_cfi_addrframe should have been freed when done. Dwfl_Module cached the reloc_info and the eh_cfi it which also should have been released when disposing of the module. Reported-by: Masatake YAMATO <[email protected]> Tested-by: Masatake YAMATO <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Add minisymtab support.Mark Wielaard2013-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an auxiliary symbol table dwfl_file aux_sym to Dwfl_Module if all we have is the dynsym table. The main file might contain a .gnu_debugdata section. The .gnu_debugdata section is a compressed embedded ELF file that contains the text (code) section symbols from the symtab table that are not in the main file dynsym table. dwfl_module_getsymtab (), dwfl_module_addrsym () and dwfl_module_getsym () will use the auxiliary symbol table when available (and no full symtab is available from the debug file). * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata, aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global. (dwfl_adjusted_aux_sym_addr): New function. (dwfl_deadjust_aux_sym_addr): Likewise. (dwfl_adjusted_st_value): Take and check symfile argument. (dwfl_deadjust_st_value): Likewise. * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and use dwfl_file as argument to set address_sync. (find_debuginfo): Call find_prelink_address_sync with debug file. (find_aux_sym): New function. (find_symtab): Use find_aux_sym if all we have is the dynsym table and fill in aux DwflModule fields. (dwfl_module_getsymtab): Return syments plus aux_syments. (load_symtab): Always set first_global. * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile when using same_section. Calculate first_global based on both mod->first_global and mod->aux_first_global. * dwfl_module.c (__libdwfl_module_free): Free aux_sym. * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table to retrieve symbol and name if necessary, making sure all locals from any table come before any globals. * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value with symfile. * relocate.c (resolve_symbol): Likewise. https://fedoraproject.org/wiki/Features/MiniDebugInfo 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]>
* Fix up bogon and missing log entries from .pmachata.threads branch.Roland McGrath2008-08-251-54/+23
|
* 2007-10-23 Roland McGrath <[email protected]>Roland McGrath2007-10-231-6/+4
| | | | | | * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel module to appear first.
* src/Roland McGrath2007-10-041-0/+3
| | | | | | | | | | | | | | | | | | | | 2007-10-04 Roland McGrath <[email protected]> * readelf.c (print_archive_index): New variable. (options, parse_opt): Accept -c/--archive-index to set it. (dump_archive_index): New function. (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX. Call dump_archive_index on archives if set. (main): Update caller. (any_control_option): Give it file scope, moved out of ... (parse_opt): ... here. tests/ 2007-10-04 Roland McGrath <[email protected]> * run-readelf-test4.sh: New file. * Makefile.am (TESTS, EXTRA_DIST): Add it.
* libdwfl/Roland McGrath2007-07-161-0/+1
| | | | | | | | | | | | | | | 2007-07-16 Roland McGrath <[email protected]> * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when reviving an existing module. tests/ 2007-07-16 Roland McGrath <[email protected]> * dwfl-bug-report.c: New file. * Makefile.am (noinst_PROGRAMS, TESTS): Add it. (dwfl_bug_report_LDADD): New variable.
* 2007-04-24 Roland McGrath <[email protected]>Roland McGrath2007-04-251-0/+1
| | | | | * run-strip-test.sh: When we saved the debug info, test unstrip too.
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2007-03-301-0/+1
| | | | | | b584b7056d679db0fc272b47667047d07737ca55) to branch 'com.redhat.elfutils' (head 5f150a0b2f07e8c60913d4e6ad833ef026ccd26e)
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2007-03-131-9/+27
| | | | | | e0c7abd450c9e49093cfae30af8a22782a74a403) to branch 'com.redhat.elfutils' (head 2c784d50eee72e33972c333138a3a28df304da63)
* remove extra log entryRoland McGrath2006-12-291-1/+3
|
* Correct result for whole address range in compare_modules.Ulrich Drepper2006-12-291-3/+2
|
* propagate from branch 'com.redhat.elfutils' (head ↵Roland McGrath2006-12-171-1/+1
| | | | | | b4944cf70801d9dac056f4f80ef1334e5acb8bdc) to branch 'com.redhat.elfutils.roland.pending' (head e7e402c668fb0670fc5f6b6a522853ae88f32f11)
* merge of 67f3844b544f03a64b3ac896c19f94744923d76aUlrich Drepper2006-07-121-1/+1
| | | | and ba017f6b59b4ad649cf32f4eefdfecca8b31332c
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-07-121-1/+1
| | | | | | e5cfdd13aa39dfae16b905fd57ff56ad8a131bb5) to branch 'com.redhat.elfutils' (head 60222fc1981540f15e674b6705fd7a6f628f95a4)
* Adjust for internal_function_def removal.Ulrich Drepper2006-07-121-1/+1
|
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2006-07-121-5/+6
| | | | | | 1ac619debea0e3ecfd2704e8bdc803c6c893b62a) to branch 'com.redhat.elfutils' (head 830d38d0a2ce24911160a871963f093209e69d9e)
* Fix overflow in compare_modules return value.Ulrich Drepper2006-07-111-2/+9
|
* 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-10/+46
| | | | | | 4f8fc821345feef58624f0aa5b470d4827577d8c) to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
* 2005-08-23 Roland McGrath <[email protected]>Roland McGrath2005-08-231-0/+2
| | | | | | * dwarf_attr_integrate.c (dwarf_attr_integrate): Treat DW_AT_specification the same as DW_AT_abstract_origin.
* libdw/Roland McGrath2005-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | 2005-08-09 Roland McGrath <[email protected]> * dwarf_end.c: Add INTDEF. * dwarf_error.c (dwarf_errmsg): Likewise. * libdwP.h (dwarf_end, dwarf_errmsg): Add INTDECLs. libdwfl/ 2005-08-09 Roland McGrath <[email protected]> * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs. * cu.c: Use INTUSE on dwarf_* calls. * dwfl_error.c: Likewise. * dwfl_module.c: Likewise. * dwfl_module_getdwarf.c: Likewise. * dwfl_module_getsrc_file.c: Likewise. * lines.c: Likewise.
* Adjust for monotone.Ulrich Drepper2005-07-261-0/+188