summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Build installable libraries with -fpic, -fvisibility=hiddenpmachata/RH-DTSPetr Machata2013-10-176-1/+6
| | | | | The test case has to be changed to look for files with different names. That because per-target rules cause file renaming in autoconf.
* Don't rely on dlopen for EBL backendsPetr Machata2013-10-1711-658/+141
| | | | | | | | | | | | | | | - EBL was modified to avoid dlopen and instead relies on all supported backends being linked in. - backends/libebl_static_pic.a and libcpu/libcpu_static_pic.a contain selected backends to be linked statically together with libebl.a - libdw/libdw_static_pic.a is a minimal subset of libdw containing symbols that the above two archives reference. Binaries that don't link libdw but use libebl need to link in libdw_static_pic. This only for internal uses, externally we only support libdw. - Test cases that excercise EBL on unsupported platforms were disabled
* Update Ukrainian translationYuri Chornoivan2013-10-101-48/+54
| | | | Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
* backends: ppc_abi_cfi reg1 use DW_CFA_val_offset not DW_CFA_val_expression.Mark Wielaard2013-10-078-3/+32
| | | | | | | | | | | | | | | 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 <mjw@redhat.com>
* libdw: Make sure that every debug_types sig8 is hashedJosh Stone2013-10-037-2/+111
| | | | | | | | | | | | 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 <jistone@redhat.com>
* Update elf.h from glibcPetr Machata2013-10-012-2/+154
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* 0.157 release updates for NEWS, elfutils.spec.in and .po files.elfutils-0.157Mark Wielaard2013-09-3010-1977/+2009
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Show contents NT_FILE core note in readelfPetr Machata2013-09-304-4/+84
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* Show contents NT_SIGINFO core note in readelfPetr Machata2013-09-306-2/+174
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* libdw: Fix compiler warnings on 32-bit.Mark Wielaard2013-09-303-6/+17
| | | | | | | | Don't cast directly to/from Dwarf_Word (uint64_t) to/from pointers, but use uintptr_t as intermediary to prevent cast to pointer from integer of different size warnings. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Recognize names of some new core note types in ebl_core_note_type_namePetr Machata2013-09-272-1/+11
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* Prepare 0.157 release.Mark Wielaard2013-09-2710-407/+445
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Update elf.h from glibcPetr Machata2013-09-262-111/+261
| | | | Signed-off-by: Petr Machata <pmachata@redhat.com>
* libdw: Simplify __libdw_visit_scopes' tag checksJosh Stone2013-09-252-34/+21
| | | | | | | | | | | | | | | | The former classify_die() was splitting tags into more classes than actually needed. The one place that used the "imported" die_class now just compares to DW_TAG_imported_unit directly. The recursion check was squashing "match", "match_inline", and "walk" into the same action. Now that uses the new may_have_scopes(), which just returns true for all tags that had those classifications. The net result has no functional change, but performs better. Signed-off-by: Josh Stone <jistone@redhat.com>
* eblsectionstripp.c (ebl_section_strip_p): Check shdr_l is not NULL.Mark Wielaard2013-09-252-2/+6
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Make dwarf_getfuncs find all (defining) DW_TAG_subprogram DIEs.Mark Wielaard2013-09-249-31/+162
| | | | | | | | | | | | | | | | | | | | | | | | dwarf_getfuncs used to return only the DW_TAG_subprogram DIEs that were direct children of the given CU. This is normally how GCC outputs the subprogram DIEs. But not always. For nested functions the subprogram DIE is placed under the code construct DIE where it is nested. Other compilers might output the defining subprogram DIE of a C++ class function under the DW_TAG_namespace DIE where it was defined. Both such constructs seem allowed by the DWARF specification. So just searching the CU DIE children was wrong. To find all (defining) subprogram DIEs in a CU dwarf_getfuncs should use __libdw_visit_scopes to walk the tree for all DIEs that can contain subprograms as children. The only tricky part is making sure the offset returned and used when the callback returns DWARF_CB_ABORT is correct and the search continues at the right spot in the CU DIE tree. This operation now needs to rewalk the whole tree. Two new testcases were added that fail without this patch. And the allfcts test was tweaked so that it always returns DWARF_CB_ABORT from its callback to make sure the offset handling is correct. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Make sure --enable-dwz code is also tested during make distcheck.Mark Wielaard2013-09-202-1/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: Fix memory leak in cu.c on bad DWARF.Mark Wielaard2013-09-122-1/+8
| | | | | | If libdw dwarf_offdie fails free cu structure. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix memory leak and set libdw errno when intern_fde cannot parse start/end.Mark Wielaard2013-09-122-1/+10
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl: proc_maps_report should not fclose the given file.Mark Wielaard2013-09-122-1/+5
| | | | | | | | | Calling fclose only on bad_report, but not on other errors or success is confusing. The caller is always responsible for calling fclose on the given file. Otherwise flcose might be called twice (e.g. in dwfl_linux_proc_report). Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix typo in dwfl_module_getdwarf.c (find_symtab).Mark Wielaard2013-09-122-1/+6
| | | | | | | Call elf_getdata with aux_xndxscn, not xndxscn, for aux_symxndxdata. This was a copy/paste error from the code just above for symxndxdata. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add new varlocs test for dwarf_getlocation* functions.Mark Wielaard2013-09-0614-3/+1064
| | | | | | | | | | | | This tests the new dwarf_getlocations, dwarf_getlocation_attr and dwarf_getlocation_die functions. But it is also an example of how to handle location expressions and which libdw functions can be used to access all information required to interpret each DW_OP. It might make sense to extend this test/example into a program that verifies various properties of DWARF expressions. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Add new functions dwarf_getlocation_attr and dwarf_getlocation_die.Mark Wielaard2013-09-068-18/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some location expression operations have a DIE associated with them. Examples are some of the new GNU typed DWARF extensions, DW_OP_GNU_convert, DW_OP_GNU_reinterpret, DW_OP_GNU_const_type, DW_OP_GNU_regval_type and DW_OP_GNU_deref_type. Others have (block) values associated with them, like DW_OP_GNU_entry_value and DW_OP_GNU_const_type. It is not always easy to access these values. The DIE offset is given in various formats either as global offset or CU relative offset. The (block) value might be constant or a location description. And the block might be encoded with a uleb128 or ubyte length. The new functions help to easily get at the DIE or attribute value. In theory dwarf_getlocation_attr could be used for all cases, since besides returning DW_AT_const_value or DW_AT_location, it could also return an attribute referencing a DIE. But at least one operation, DW_OP_GNU_const_type, has both a (type) DIE and a constant (block) value associated with it. And directly getting the DIE when needed is easier than first having to retrieve a (synthesized) attribute and then getting the actual (type) DIE. Expression operations that reference an actual DIE for the DW_AT_location or DW_AT_const_value, like DW_OP_call2, DW_OP_call4, DW_OP_callref and DW_OP_GNU_implicit_pointer can be used with both dwarf_getlocation_attr and dwarf_getlocation_die. DW_OP_implicit_value and DW_OP_GNU_implicit_pointer already had their own special accessors (dwarf_getlocation_implicit_value and dwarf_getlocation_implicit_pointer), but it seemed consistent to include them in the new more generic accessors too. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Add new function dwarf_getlocations.Mark Wielaard2013-09-064-68/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using dwarf_getlocation it is possible to get single location descriptions and with dwarf_getlocation_addr it is possible to get a location list covering a specific address. But sometimes it is more convenient to get all ranges covered by a location list. For example when a specific address isn't covered and you want to find alternative addresses where a location description is defined. dwarf_getlocations is modelled after dwarf_ranges. It enumerates the location ranges and descriptions covered by the given attribute. In the first call OFFSET should be zero and *BASEP need not be initialized. Returns -1 for errors, zero when there are no more locations to report, or a nonzero OFFSET value to pass to the next call. Each subsequent call must preserve *BASEP from the prior call. Successful calls fill in *STARTP and *ENDP with a contiguous address range and *EXPR with a pointer to an array of operations with length *EXPRLEN. If the attribute describes a single location description and not a location list the first call (with OFFSET zero) will return the location description in *EXPR with *STARTP set to zero and *ENDP set to minus one. ptrdiff_t dwarf_getlocations (Dwarf_Attribute *attr, ptrdiff_t offset, Dwarf_Addr *basep, Dwarf_Addr *startp, Dwarf_Addr *endp, Dwarf_Op **expr, size_t *exprlen); Signed-off-by: Mark Wielaard <mjw@redhat.com>
* backends: Hook abi_cfi for arm.Mark Wielaard2013-09-038-3/+180
| | | | | | | | | | | | | | | | | | | | | | New arm_abi_cfi that defines initial CFA, rules for callee-saved regs, including VFP ones and return register. Note the DWARF abi extension for ARM says that "registers intentionally unused" should also be initialized as if by DW_CFA_same_value. The example given is "an integer-only function might be included in one executable file for targets with VFP and another for targets without". We don't currently do this yet. See the DWARF and calling convention documents: DWARF for the ARM Architecture ABI r2.09 http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040b/IHI0040B_aadwarf.pdf Procedure Call Standard for the ARM Architecture ABI r2.09 http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf Also adds addrcfi arm testcase. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add s390 and s390x addrcfi testcases.Mark Wielaard2013-09-036-1/+172
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add ppc32 and ppc64 addrcfi testcases.Mark Wielaard2013-09-036-3/+2096
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* backends: Hook abi_cfi for ppc and s390.Jan Kratochvil2013-09-027-7/+164
| | | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* tests: Add run-addrcfi.sh test for libdw cfi dwarf_frame_* functions.Mark Wielaard2013-09-024-6/+298
| | | | | | | | | | | | | | | | | We require architecture backends to implement the ebl abi_cfi hook to provide the ABI's default CFI program as used by the libdw dwarf cfi functions. There is the addrcfi test program that prints the return address, cfa location expression and register states as returned by various dwarf_cfi_* and dwarf_frame functions. But that has to be run by hand. The new run-addrcfi.sh tests hooks addrcfi up to some existing architecture specific test files and known addresses to more easily (and automaticly) check that the default CFI program is implemented correctly and to test the libdw cfi frame info functionality. Only i386 and x86_64 are tested for now since other backends don't have the abi_cfi hook yet. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* backends: Always set *prefix to "" when not used in register_info hook.Mark Wielaard2013-09-024-3/+9
| | | | | | | | | | | | For ia64 and tilegx *prefix was already set to the empty string, but arm, ppc and sh used NULL to indicate no prefix preceded the register name in the canonical assembler syntax. Consistently use the empty string in all backends since dwfl_module_register_names says: 'a prefix used in assembler syntax (such as "%" or "$", may be "")'. So users had to handle the empty string already, and might forget to handle the NULL case (like our own addrcfi testcase). Signed-off-by: Mark Wielaard <mjw@redhat.com>
* gelf.h: Fix typo in comment.Namhyung Kim2013-08-282-1/+5
| | | | | Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* gelf_getauxv: Add missing whitespace.Mark Wielaard2013-08-282-2/+6
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* gelf_getauxv: Remove unnecessary casts to char *.Mark Wielaard2013-08-272-1/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* gelf_getauxv: Use memcpy, not pointer deref, to avoid alignment problems.Kurt Roeckx2013-08-262-1/+7
| | | | | Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwfl/linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true.Mark Wielaard2013-08-262-1/+12
| | | | | | | | | | On some architectures (e.g. x86_64) the vmlinux is ET_EXEC, while on others (e.g. ppc64) it is ET_DYN. In both cases the phdr p_vaddr will be non-zero. We want the image to be placed as if it was ET_DYN, so pass true for add_p_vaddr which will do the right thing (in combination with a zero base) in either case. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* CONTRIBUTING: Fix typo.Mark Wielaard2013-08-211-1/+1
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* addr2line: Support -i, --inlines output option.Mark Wielaard2013-08-136-22/+286
| | | | | | | | | | | | Show all source locations that caused inline expansion of subroutines at the given address. This can easily be supported by using libdw dwarf_getscopes_die which will give all nested inlined subroutines. When -f, --functions is given also show the function names where the subroutines were inlined. The output matches that of binutils addr2line --inlines. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* addr2line: Remove newline from strings returned by getline.Mark Wielaard2013-08-125-3/+92
| | | | | | | | | | | getline can return strings with a newline as last character when reading from stdin. This could cause confusing symbol lookup failures like: addr2line: cannot find symbol 'foo ' So if the last character of the buf returned by getline is a newline just null-terminate it right there. Also add a new testcase run-addr2line-test.sh. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Prepare 0.156 release.elfutils-0.156Jan Kratochvil2013-07-2510-3128/+3773
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Fix run-unstrip-n.sh regression on CentOS-5 ppc.Jan Kratochvil2013-07-252-21/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | last patch was a bit more heuristic than needed which was found on RHEL-5 ppc (32-bit): FAIL: run-unstrip-n.sh (exit: 1) ================================ --- unstrip.out 2013-07-23 23:23:49.000000000 +0200 +++ - 2013-07-23 23:23:49.434052534 +0200 @@ -4,4 +4,3 @@ 0xfdf0000+0x1c0000 edf3dd232e09d01b90683889bd16b9406c52d4de@0xfdf0184 - - libc.so.6 0xffb0000+0x50000 edec437a85026a1cf8cda94003706202733130c1@0xffb0124 - - ld.so.1 0x10000000+0x20000 979b7a26747cc09bd84a42b311b5288c704baea5@0x10000174 . - [exe] -0xf880000+0x201d4 - /lib/librt.so.1 /usr/lib/debug/lib/librt-2.5.so.debug librt.so.1 Therefore the new code generated this excessive line: 0xf880000+0x201d4 - /lib/librt.so.1 /usr/lib/debug/lib/librt-2.5.so.debug librt.so.1 The first part of debug dump is from DT_DEBUG, second part is from segments: start=0xf880000 end=0xf8a01d4 l_ld=0xfd6fe20 name=/lib/librt.so.1 start=0xfc60000 end=0xfe031e4 l_ld=0xff9e270 name=/lib/libc.so.6 start=0xfe10000 end=0xfe421dc l_ld=0xfddfd98 name=/lib/libpthread.so.0 start=0xffb0000 end=0xfff0668 l_ld=0xffef9ac name=/lib/ld.so.1 module_start=0x100000 module_end=0x110000 dyn_vaddr=0x100ee4 module_start=0xfd50000 module_end=0xfd80000 dyn_vaddr=0xfd6fe20 /lib/librt.so.1 module_start=0xfdb0000 module_end=0xfdf0000 dyn_vaddr=0xfddfd98 /lib/libpthread.so.0 module_start=0xfdf0000 module_end=0xffb0000 dyn_vaddr=0xff9e270 /lib/libc.so.6 module_start=0xffb0000 module_end=0x10000000 dyn_vaddr=0xffef9ac /lib/ld.so.1 module_start=0x10000000 module_end=0x10020000 dyn_vaddr=0x10010850 When comparing conflicts for (found in segments) module_start=0xfd50000 module_end=0xfd80000 dyn_vaddr=0xfd6fe20 /lib/librt.so.1 the code found this line conflicts (and discarded it): start=0xfc60000 end=0xfe031e4 l_ld=0xff9e270 name=/lib/libc.so.6 but it did not discard also conflicting: start=0xf880000 end=0xf8a01d4 l_ld=0xfd6fe20 name=/lib/librt.so.1 So I have changed/improved the algorithm - L_LD can be IMO compared exactly but otherwise the ranges should be compared for every module, not just the first one. Again I am not much happy from this code, it should be using NT_FILE instead, but when we keep compatibility with old OSes elfutils should not regress there. libdwfl/ 2013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com> * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for conflicts all the modules, not just the first one. Compare L_LD if it is equal, not if it is in a module address range. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* __libdwfl_elf_address_range: Add missing internal_function keyword.Jan Kratochvil2013-07-232-1/+5
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Fix false match of non-build-id disk library to build-id memory library.Jan Kratochvil2013-07-238-41/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch: Use DT_DEBUG library search first. 8ff862960efb648cdff647d7fad1be5acffe9b11 [patch 2/2] Fix loading core files without build-ids https://lists.fedorahosted.org/pipermail/elfutils-devel/2013-April/003031.html [patch 2/2 v2] Fix loading core files without build-ids https://lists.fedorahosted.org/pipermail/elfutils-devel/2013-May/003065.html has PASS->FAIL regression on CentOS-5 for run-unstrip-n.sh: -actual on CentOS-5 +expected by testcase -0xf77b3000+0x822c - /lib/librt.so.1 - librt.so.1 -0xf7603000+0x15c5c4 - /lib/libc.so.6 - libc.so.6 -0xf75e9000+0x191e4 - /lib/libpthread.so.0 - libpthread.so.0 -0xf77d7000+0x1c670 - /lib/ld-linux.so.2 - ld-linux.so.2 0x8048000+0x2000 f1c600bc36cb91bf01f9a63a634ecb79aa4c3199@0x8048178 . - [exe] +0xf75e9000+0x1a000 29a103420abe341e92072fb14274e250e4072148@0xf75e9164 - - libpthread.so.0 +0xf7603000+0x1b0000 0b9bf374699e141e5dfc14757ff42b8c2373b4de@0xf7603184 - - libc.so.6 +0xf77b3000+0x9000 c6c5b5e35ab9589d4762ac85b4bd56b1b2720e37@0xf77b3164 - - librt.so.1 0xf77d6000+0x1000 676560b1b765cde9c2e53f134f4ee354ea894747@0xf77d6210 . - linux-gate.so.1 +0xf77d7000+0x21000 6d2cb32650054f1c176d01d48713a4a5e5e84c1a@0xf77d7124 - - ld-linux.so.2 Therefore elfutils now incorrectly matches on-disk file without build-id to an in-core (in-memory) file with build-id. In fact due to its known FIXME: This verification gives false positive if in-core ELF had build-id but on-disk ELF does not have any. But we cannot reliably find ELF header and/or the ELF build id just from the link map (and checking core segments is also not reliable). */ So it probably should not be so ignorable as I did, one may want to analyze build-id core files on CentOS-5, not sure. In fact it can be fixed, when we find in dwfl_segment_report_module a module with build-id with conflicts in its address range with existing non-build-id dwfl_link_map_report module we should prefer the build-id module instead. The problem is that once Dwfl_Module is added to Dwfl it cannot be easily removed. Originally elfutils called dwfl_segment_report_module first and then dwfl_link_map_report. Currently the order is dwfl_link_map_report and then dwfl_segment_report_module only for modules missing from dwfl_link_map_report. Patch below unfortunately needs bidirectional negotiation between the two functions, therefore dwfl_link_map_report now no longer adds Dwfl_Modules to Dwfl but it only stores information about them to r_debug_info_module. This information is filtered then by dwfl_segment_report_module and only filtered r_debug_info_module entries get finally added to Dwfl (in dwfl_core_file_report). NT_FILE would make all this magic easy but it is true that on CentOS-5 it definitely does not exist. libdwfl/ 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com> * core-file.c (clear_r_debug_info): Close also ELF and FD. (dwfl_core_file_report): Call __libdwfl_report_elf for R_DEBUG_INFO.MODULE. * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from code of ... (__libdwfl_report_elf): ... this function. Call it. * dwfl_segment_report_module.c: Include unistd.h. (dwfl_segment_report_module): Use basename for MODULE->NAME. Clear MODULE if it has no build-id and we have segment with build-id. Ignore this segment only if MODULE still contains valid ELF. * libdwflP.h (__libdwfl_elf_address_range): New declaration. (struct r_debug_info_module): New fields fd, elf, l_addr, start, end and disk_file_has_build_id. (dwfl_link_map_report): Extend the comment. * link_map.c (report_r_debug): Extend the comment. Always fill in new r_debug_info_module. Initialize also the new r_debug_info_module fields. Remove one FIXME comment. Call __libdwfl_elf_address_range instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL. tests/ 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com> * run-unstrip-n.sh (test-core.*): Ignore libc.so.6 entry and order of the entries. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS: Remove bugfix only entries from Version 0.156.Jan Kratochvil2013-07-192-41/+9
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* __libdwfl_find_elf_build_id: Add missing internal_function keyword.Jan Kratochvil2013-07-192-1/+6
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS: Add entries for Version 0.156.Jan Kratochvil2013-07-192-0/+69
| | | | Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* readelf: print actual DIE offsets of DW_OP_GNU_<type> ops.Mark Wielaard2013-07-131-2/+17
| | | | | | | | | | | | | Like DW_OP_GNU_parameter_ref the DW_OP_GNU type conversion ops DW_OP_GNU_const_type, DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert and DW_OP_GNU_reinterpret take a CU relative offset to a DIE (in these cases a DW_TAG_base_type). So handle the DIE offsets just like in the DW_OP_GNU_parameter_ref case by adding the cu->start if known (and -U hasn't been given). For DW_OP_GNU_convert and DW_OP_GNU_reinterpret handle zero specially since it means to "untype" the result and so isn't an actual DIE reference. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: print actual DW_OP_GNU_parameter_ref DIE offset.Mark Wielaard2013-07-132-32/+66
| | | | | | | | | | | DW_OP_GNU_parameter_ref takes as argument a CU relative offset to a DW_TAG_formal_parameter DIE. Printing just that relative offset makes it hard to find the actual DIE in the output. Now print the actual DIE offset instead (unless -U is given). We already passed around the base address of the CU. Now we pass around the actual CU so we can use it to find both the base address and the CU offset. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw. Don't blow up stack in dwarf_getsrclines with lots of lines.Mark Wielaard2013-07-102-8/+33
| | | | | | When a CU has a really large number of lines dwarf_getsrclines could blow up the stack because it uses alloca for temporary storage. Use malloc and free if the number of lines gets too big.
* Don't assert on mod->e_type in __libdwfl_relocate_value.Mark Wielaard2013-07-082-2/+4
| | | | | | | | | When setting up the module and searching for an ELF file with a correct build_id __libdwfl_relocate_value will be called for an ET_REL file in __libdwfl_find_elf_build_id but mod->e_type is not yet setup in that case because the Dwfl_Module isn't yet complete (the build-id could mismatch). This can happen when using the dwfl_linux_kernel_find_elf callback when it searches for the ELF file matching a kernel module.
* getcfi_scn_eh_frame: Don't crash and burn when .eh_frame bits aren't there.Mark Wielaard2013-07-082-2/+11
| | | | | | | | Trying to read non-existing bits sometimes works and normally a sanity check will fail. But it could also lead to an unexpected crash much later when trying to use the non-existing data. Signed-off-by: Mark Wielaard <mjw@redhat.com>