summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libdw: Try both the relative and absolute paths when finding a .dwo file.Mark Wielaard2018-06-014-47/+92
| | | | | | | | We would give up if one of them failed. With this fixed a self-test with make check succeeds when building elfutils itself with CFLAGS set to "-gdwarf-4 -gdwarf-split -O2". Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Fix .debug_types printing with implicit section_info.Mark Wielaard2018-06-015-6/+149
| | | | | | | | | | | | | Commit 314e9d7d "readelf: Handle .debug_info first if any other debug section needs it" disabled section_info printing if it was already handled. But section_types was an alias for section_info. So unless section_info was explicitly printed, .debug_types wasn't. Make section_types its own thing to print .debug_types and make section_info imply section_types. Add a testcase to make sure .debug_types is now printed. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Deal with combined normal and split dwarf DebugFission .debug_loc.Mark Wielaard2018-06-018-3/+359
| | | | | | | | | | | | | Normal and split dwarf from GNU DebugFission look the same, but should be treated competely separtely. When having a file with both skeletons and real compile units only note the secoffsets into the real .debug_loc in readelf. Otherwise or known_locslistptr will get confused. Add a testfile that combines an normal -gdwarf-4 object with a -gsplit-dwarf object. libdw already got this right, but add a run-varlocs.sh test to make sure. Signed-off-by: Mark Wielaard <[email protected]>
* tests: Split self_test_files into an exe, lib and obj list.Mark Wielaard2018-06-014-6/+53
| | | | | | | | | | Introduce testrun_on_self_exe and testrun_on_self_lib. Some tests cannot handle (unrelocated) ET_REL object files. run-get-units-split.sh and run-unit-info.sh only handle executables and shared libraries. This allows running the whole testsuite on an elfutils build done with CFLAGS="-gdwarf-4 -gsplit-dwarf -O2". Signed-off-by: Mark Wielaard <[email protected]>
* tests: Run run-low_high_pc.sh testcase on split dwarf files.Mark Wielaard2018-06-013-6/+46
| | | | | | | Test that the low high pc attributes can be properly resolved also in split dwarf setups. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Fix overflow warning on 32bit systems with GCC8 in dwarf_getsrclines.Mark Wielaard2018-05-312-2/+9
| | | | | | | | ndirs is read from the debug data and should be size checked before use. https://sourceware.org/bugzilla/show_bug.cgi?id=23248 Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Use correct listptr when looking up next loc for locview attr.Mark Wielaard2018-05-312-1/+6
| | | | | | | | We were using loclistsptr instead of locsptr in print_debug_loc_section. https://sourceware.org/bugzilla/show_bug.cgi?id=23247 Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Don't crash on invalid die in dwarf_dieoffset.Mark Wielaard2018-05-316-4/+30
| | | | | | | | Add explicit test in get-units-invalid for dwarf_cuoffset and dwarf_dieoffset. Make sure dwarf_dieoffset returns (Dwarf_Off) -1 on failure. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle split Dwarf Dies in dwarf_die_addr_die.Mark Wielaard2018-05-3110-2/+133
| | | | | | | | | | | | | | | | | | | dwarf_die_addr_die can be used to turn an Dwarf_Die addr back into a full Dwarf_Die, just given the original Dwarf debug handle. This now also works for Dwarf_Dies which originated from a split Dwarf. Whenever a split Dwarf_CU is found the Dwarf it originated from is registered with the Dwarf that the skeleton Dwarf_CU came from. All registered split Dwarfs are then searched by dwarf_die_addr_die if the addr didn't match the main Dwarf or the alt Dwarf. One limitation in this implementation is that only DIEs that come from the main .debug_info in the .dwo are supported. Theoretically there could also be DIEs in an .debug_type or from other/multiple (comdat) sections. New tests are added for dwarf-4, dwarf-5, split-dwarf-4, split-dwarf-5 and version 4 and 5 dwo files. Signed-off-by: Mark Wielaard <[email protected]>
* readelf, libdw: Add GNU DebugFission .debug_loc support.Mark Wielaard2018-05-318-7/+382
| | | | | | | | | | GNU DebugFission .debug_loc location lists uses the .debug_loc section in the split dwarf .dwo file. The encoding is a mix of old style DWARF .debug_loc and new style .debug_loclists. Add two testcases for the readelf and libdw decoders. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Fix regression with multiple files and implicit debug_info reading.Mark Wielaard2018-05-314-2/+60
| | | | | | | | | | | | | | Commit 314e9d7d "readelf: Handle .debug_info first if any other debug section needs it" introduced a regression when handling multiple files. The implicit and explicit printing of debuginfo weren't reset and so the second file would not show (or scan) the .debug_info section when needed. Fix by resetting the implicit and explicit section printing flags. Add a testcase that prints the .debug_loc section for two files and check that the CUs are resolved. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Fix memory corruption in libdw_find_split_unit.Mark Wielaard2018-05-307-9/+56
| | | | | | | | | | | Found by valgrind when trying to match a split unit from a .dwo file that doesn't contain the split unit (as first) match. We would close the split Dwarf too early, before we had inspected all units in it. Add a testcase that simulates this. Which failed (at least under valgrind as run by make distcheck) before the fix. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Handle .debug_str_offsets.Mark Wielaard2018-05-305-3/+440
| | | | | | | | | | | | | | | | The .debug_str_offsets tables are indirect string offsets into the .debug_str section. For DWARF5 they can be in both the main, skeleton and split dwarf (.dwo) files. For DWARF4 with the GNU DebugFission extension the tables will not have an header and they will only be in the split DWARF (.dwo) file, never in the main (skeleton) file. For DWARF5 the (non-split) unit DIE will have a DW_AT_str_offsets_base attribute pointing at the actual index (after the header). The split unit will never have this attribute (and use the table at offset zero). Signed-off-by: Mark Wielaard <[email protected]>
* readelf handle .debug_addr section.Mark Wielaard2018-05-306-4/+431
| | | | | | | | | | Add debug-dump=addr which will show the .debug_addr section tables. The only tricky bit is the fact that GNU DebugFission, a DWARF4 extension, didn't produce unit table headers. So if we see a mixed DWARF4/5 .debug_addr table we have to reconstruct the table length from the CU DIE DW_AT_[GNU_]_addr_base offsets. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle .debug_loclists in dwarf_getlocation.Mark Wielaard2018-05-3013-25/+539
| | | | | | | | | | | | | Handle all new DW_LLE opcodes in .debug_loclists in dwarf_getlocation. __libdw_read_begin_end_pair_inc now also handles a default location (which is simply the range [0,-1]). Since expression blocks can now also come from the .debug_loclists section add a new fake_loclists_cu necessary for checking bounds while parsing expression blocks. Adapt varlocs test to handle debug-only files. Test testfileranges5.debug and testfilesplitranges5.debug with it. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Handle .debug_loclists.Mark Wielaard2018-05-2911-22/+1191
| | | | | | | | | The new DWARF5 .debug_loclists sections are like .debug_rnglists, but plus locations. For Split Dwarf GCC generates the .debug_loclists fully in the split .dwo file. Any references to addresses need to be resolved through the skeleton .debug_addr section. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Allow partial relocations also for debug files.Mark Wielaard2018-05-292-1/+6
| | | | | | | | | | | | | | __libdwfl_relocate is called for get_dwarf and get_elf. We allow not all relocations to be resolved for Elf files, but required all relocations (in the debug sections) to be fully resoled in Dwarf files. This used to mostly work out with .o ET_REL files when the main Elf was gotten before the Dwarf. But with .dwo files, we (readelf) might open the .o file just for the (skeleton) Dwarf. In this case it could happen not all relocations in the debug sections could be resolved (.debug_info and .debug_addr might contain referenes to undefined symbols). So allow partial relocations also for debug files. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Find skeleton units when inspecting split .dwo (--dwarf-skeleton).Mark Wielaard2018-05-285-43/+288
| | | | | | | | | | | | | | | | | | | To get the right context (especially addresses) when looking at a .dwo file we really need the skeleton file. If we can find it (simply replace .dwo with .o) then use that to get to the split DWARF units so that libdw sets up all relevant information to resolve. Also adds a --dwarf-skeleton option so the user can explicitly give a skeleton file to use (for example when all .o files are linked and removed already). Unfortunately this might not work if libdw cannot get from the skeleton file to the .dwo file (because they have been moved around). In that case eu-readelf "cheats", it will link up the libdw datastructures so that the skeleton and split DWARF units are setup correctly anyway. This does introduce a problem when trying to cleanup the Dwarf handle ownership graph. So we will deliberately leak memory by not closing the underlying Dwfl in that case. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle .debug_rnglists in dwarf_ranges.Mark Wielaard2018-05-2815-79/+453
| | | | | | | | | Handle all new DW_RLE opcodes in .debug_rnglists in dwarf_ranges. Extract code for reading .debug_addr indexes from dwarf_formaddr as __libdw_addrx to reuse in __libdw_read_begin_end_pair_inc. And add new testcase for "plain" DWARF5 and add a new test all-dwarf-ranges to test split DWARF5. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Add .debug_rnglists support.Mark Wielaard2018-05-2712-22/+817
| | | | | | | | Parse the .debug_rnglists section for DWARF5 --debug-dump=ranges. Add testcase to show both "normal" and "split" DWARF variants are handled for DWARF4 and DWARF5. Signed-off-by: Mark Wielaard <[email protected]>
* __libdw_cu_addr_base: Cast offset to uintptr_t before returning as pointer.Mark Wielaard2018-05-252-1/+6
| | | | | | | | | | | | Fixes a GCC compile issue on the elfutils-debian-i686 buildbot builder: dwarf_getlocation_attr.c: In function ‘addr_valp’: dwarf_getlocation_attr.c:62:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] return (unsigned char *) offset; ^ cc1: all warnings being treated as errors Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle all address FORMs for dwarf_highpc, handle errors better.Mark Wielaard2018-05-253-17/+17
| | | | | | | | | | dwarf_highpc can use any address FORM, not just DW_FORM_addr. Just try whether the address can be resolved as address. Always set error when attribute couldn't be found or resolved. When calculating the base address for a CU don't try to second guess the error code, just treat an error the same as the attribute not being there. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Support DW_OP_addrx/constx and split DWARF addrx/constx support.Mark Wielaard2018-05-2519-41/+523
| | | | | | | | | | | | | | | | | | | DW_OP_addrx/constx and GNU DebugFission DW_OP_GNU_addr/const_index take as argument an index into the .debug_addr section for the associated CU. This index gets resolved through dwarf_getlocation_attr. A new fake addr CU is created per Dwarf for use with this new attribute. For split DWARF files, the IDX_debug_addr gets replaced with the skeleton section and the addr base is resolved immediately when constructing the split DWARF CU. Move __libdw_cu_addr_base to libdwP.h to share with eu-readelf. Also make it possible to resolve addrx[1234]/GNU_addr_index also as constant indexes to (also) show when displaying these attributes in eu-readelf. A new varlocs tests is added to test the resolving for both the DWARF4 and DWARF5 DW_OP variants. And now that addrx forms are resolved in split DWARF files add the new DIEs with "single ranges" (those DIEs that have a lowpc/highpc attribute pair) to run-all-dwarf-ranges.sh. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: print split CUs when given --debug-dump=info+Mark Wielaard2018-05-242-18/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To show the difference between "regular" CUs and split CUs print offsets and references between { and } instead of [ and ]. When --debug-dump=info+ is given (implied by -w) instead of --debug-dump=info any skeleton unit will be immediately followed by the corresponding split compile unit (from the .dwo file). DWARF section [27] '.debug_info' at offset 0x1075: [Offset] Compilation unit at offset 0: Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4 Unit type: skeleton (4), Unit id: 0xc152129eb4b99599 [ b] compile_unit abbrev: 1 ranges (sec_offset) range list [ 0] low_pc (addr) +000000000000000000 stmt_list (sec_offset) 0 GNU_dwo_name (strp) "foo.dwo" comp_dir (strp) "/tmp" GNU_pubnames (flag_present) yes GNU_addr_base (sec_offset) 0 GNU_dwo_id (data8) 0xc152129eb4b99599 GNU_ranges_base (sec_offset) 0 Split compilation unit at offset 0: Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4 Unit type: skeleton (4), Unit id: 0xc152129eb4b99599 { b} compile_unit abbrev: 1 producer (GNU_str_index) "GNU C11 7.3.0 -gsplit-dwarf -g" language (data1) C99 (12) name (GNU_str_index) "foo.c" comp_dir (GNU_str_index) "/tmp" GNU_dwo_id (data8) 0xc152129eb4b99599 { 18} subprogram abbrev: 2 external (flag_present) yes name (GNU_str_index) "main" decl_file (data1) foo.c (1) decl_line (data1) 1 type (ref4) { 2b} high_pc (data8) 3 frame_base (exprloc) [ 0] call_frame_cfa GNU_all_call_sites (flag_present) yes { 2b} base_type abbrev: 3 byte_size (data1) 4 encoding (data1) signed (5) name (string) "int" Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Add new dwarf_cu_info function.Mark Wielaard2018-05-249-5/+542
| | | | | | | | | | | | | This allows getting a (split) subdie lazily, only when needed. All arguments to dwarf_get_units are optional. When not given then unit DIE and sub DIE are not looked up. This new function allows them to be looked up when not immediately retrieved with dwarf_get_units, or for a Dwarf_CU gotten through some other way. Add a new testcase to make sure the results of calling dwarf_cu_info and dwarf_get_units are consistent. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Initialize ranges_base, add invalid DWARF test and fix expected output.Mark Wielaard2018-05-246-4/+29
| | | | | | | | We never initialized the CU ranges_base, which meant we didn't actually calculate it correctly. This caused bad ranges on some DIEs. The expected output in the testcase was wrong. We also crashed on invalid dwarf. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle GNU DebugFission split ranges.Mark Wielaard2018-05-2313-26/+281
| | | | | | | | | | | | | | | | | GNU DebugFission split dwarf handles DW_FORM_sec_offset specially for attributes that point to ranges. The .debug_ranges section is not in the .dwo file, but in the main/skeleton object file. The sec_offset is not relocated (in the ELF file), but is an offset against the skeleton DIE DW_AT_GNU_ranges_base attribute. dwarf_formudata is changed so it still looks like a normal offset ptr into the .debug_ranges section. dwarf_ranges is adapted to look for the .debug_ranges in the main object file. dwarf_highpc and dwarf_lowpc now handle the highpc and lowpc attributes being inherited for the split unit DIE from the skeleton. A new testcase is added to iterate over all ranges in a split GNU DebugFission file. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle split dwarf debuglines.Mark Wielaard2018-05-226-9/+148
| | | | | | | | | | | Split DWARF .dwo files do contain a .debug_line section, but only with the file table, there is no actual line program. Also split DWARF CU DIEs don't have a DW_AT_stmt_list attribute. To get at the file (and dir) table for a split unit DIE take just the files from the .debug_line section (at offset zero). To get the full line table use the skeleton DIE (which does have a DW_AT_stmt_list). Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Cache ELF directory early. Explicitly set it in dwfl.Mark Wielaard2018-05-2011-45/+112
| | | | | | | | | | | 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]>
* libdw: Search skeleton DIE for split compile unit DIE attributes.Mark Wielaard2018-05-208-7/+214
| | | | | | | | | dwarf_attr_integrate and dwarf_hasattr_integrate should also search for attributes from the skeleton DIE in case the given DIE is a split compile unit DIE. Split compile unit DIEs inherit various attributes from their skeleton unit DIE in DWARF5. Signed-off-by: Mark Wielaard <[email protected]>
* Mark __libdw_find_split_unit mark as internal_function.Mark Wielaard2018-05-192-1/+6
| | | | | | | The prototype and definition should match. On i386 this is important because it changes the calling convention. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: dwarf_get_units find split units from .dwo.Mark Wielaard2018-05-1918-9/+374
| | | | | | | | | | | | For a skeleton DIE dwarf_get_units should provide the split DIE as subdie. This implements that by trying to find the (named) .dwo file and finding the matching CU in it. The .dwo file is search relative to the current DWARF or using the comp_dir of the skeleton DIE. Also fixes a small issue with str_offsets_base_off which is tested in the new testcase (by getting the name of the split CU DIE). Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Recognize GNU DebugFission split units.Mark Wielaard2018-05-195-13/+42
| | | | | | | | | The split dwarf dwo unit id and type are not in the CU header itself, but can be found in the CU DIE DW_AT_GNU_dwo attributes. Use this to set the correct unit_type and id for GNU DebugFission split units. Also show this information in eu-readelf when printing units. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Add GNU DebugFission attributes, tags, forms and operands.Mark Wielaard2018-05-199-4/+74
| | | | | | Most are handled just like their DWARF5 counterparts. Signed-off-by: Mark Wielaard <[email protected]>
* libdw, readelf: Handle .debug_*.dwo section name variants.Mark Wielaard2018-05-194-21/+51
| | | | | | | | | | | The .debug_*.dwo section names are handled just like their none .dwo variants. The section contents is the same as sections without the .dwo name, but they are only found in split-dwarf files. This patch allows opening and inspecting split-dwarf files. It doesn't yet connect the split-dwarf with their skeleton (or the other way around). It also doesn't yet handle any special split-dwarf attributes or tags. Signed-off-by: Mark Wielaard <[email protected]>
* elflint: fix typo in error diagnosticsDmitry V. Levin2018-05-152-2/+6
| | | | Signed-off-by: Dmitry V. Levin <[email protected]>
* backends: add checks for _GLOBAL_OFFSET_TABLE_ and __global_pointer$ on riscvAndreas Schwab2018-05-153-0/+38
| | | | Signed-off-by: Andreas Schwab <[email protected]>
* readelf: Fix 32bit compile issues.Mark Wielaard2018-05-152-5/+11
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* readelf, libdw: Handle DWARF5 .debug_macro.Mark Wielaard2018-05-155-56/+70
| | | | | | | | | | Almost identical to GNU .debug_macro extension. Just accept and use DW_AT_macros where we accept or use DW_AT_GNU_macros. And be a little stricter in which FORMs we accept (this could have caused problems with the GNU variant too). Deals with DW_FORM_strx[1234], but not yet with imported macros through DW_MACRO_import_sup. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Add DWARF5 .debug_line support.Mark Wielaard2018-05-158-258/+1333
| | | | | | | | | | | | This only changes the parsing of the directory and file name tables. It does this by sharing the printing of (non-CU based) from data from the .debug_macro code. Adding support for printing strx[1234] form data by sharing the code that detects the correct str_offsets_base in libdw. The header format is also cleaned up a bit so that it better lines out. Testcases adjusted and new ones added. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Fix crashing on illegal/zero Dwarf_Die.Mark Wielaard2018-05-157-5/+167
| | | | | | | | | | | In some cases we create an illegal Dwarf_Die by clearing all fields. The idea is that dwarf_tag () on such a Dwarf_Die will return DW_TAG_invalid, to indicate that the Dwarf_Die is unusable (and other functions will also return errors). But when "reconstructing" the Dwarf_Die addr we might use the cu before realizing the Dwarf_Die is invalid. Fix this with an explicit NULL check and add a testcase. Signed-off-by: Mark Wielaard <[email protected]>
* addr2line: Add explicit fflush for stdout when reading from stdin.Mark Wielaard2018-05-122-0/+6
| | | | | | | | | To make it possible to use eu-addr2line interactively through a pipe we need to explicitly flush stdout after handling each line from stdin. https://sourceware.org/bugzilla/show_bug.cgi?id=23173 Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Use raw section data if nothing is available through libdw.Mark Wielaard2018-05-112-11/+28
| | | | | | | | | | For various debug data sections readelf has its own parsers that don't rely on libdw data structures or functions. But we still like to get the data through libdw since that will be uncompressed and/or relocated. But there can be reasons for libdw to have rejected the section data. In that case we want to try to parse the "raw" section data. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Handle .debug_info first if any other debug section needs it.Mark Wielaard2018-05-112-1/+45
| | | | | | | | | | Some debug sections need information from the CU DIEs to properly parse the data. Normally the .debug_info section is one of the first. But some DWARF producers reorder the sections and put it after some other debug sections. Make sure we first handle .debug_info if it is needed by any other debug section. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle DW_FORM_[ref|strp]_sup[48] as DW_FORM_GNU_[ref|strp]_alt.Mark Wielaard2018-05-116-6/+33
| | | | | | | | Although we don't yet handle DWARF5 supplemental files, they are like mostly like GNU alt files. This way using any of the supplemental files will at least generate an appropriate error message. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle DWARF5 line tables in dwarf_getsrclines.Mark Wielaard2018-05-1110-104/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | In DWARF5 the actual line number table format doesn't change, except for not allowing DW_LNE_define_file (but we still just accept it). The changes are the header having new fields for address and segment selector sizes, and new formats for the directory and file names tables. The directory and file name tables are much more flexible in DWARF5, but we only interpret the actual names and file/dir index relationships, skipping/ignoring any other information. There also is no new interface yet to get at the new directory and file properties. There is some small confusion about the file name table indexing. Older DWARF versions explicitly called the first file name table 1. DWARF5 implies the first index is 0 (but for file attributes, zero means not associated with a file). We get away with that by having an actual zero index for older DWARF versions (the null_fill). It looks like gcc gets around it by explicitly duplicating the first (0) and second (1) file name entry in the table. This can also be seen in the new testcase. The patch looks big because of moving a few initializations around and because the code that is different for older/newer DWARF got moved under if statements. But the original old DWARF code path didn't really change. Signed-off-by: Mark Wielaard <[email protected]>
* libebl: Add new DWARF5 debug section names to default_debugscn_p.Mark Wielaard2018-05-062-0/+13
| | | | | | | | | | | | This adds the new DWARF5 debug section names .debug_addr, .debug_line_str, .debug_loclists, .debug_names, .debug_rnglists and .debug_str_offsets. This makes sure eu-strip knows to strip them away. Note that it doesn't add the .dwo variants, nor the .dwp only section names .debug_cu_index and .debug_tu_index, nor the .debug_sup section for supplemental DWARF files. Signed-off-by: Mark Wielaard <[email protected]>
* readelf: Handle .debug_line_str section.Mark Wielaard2018-05-062-8/+20
| | | | | | It is just a .debug_str section with another name. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Handle DW_FORM_line_strp.Mark Wielaard2018-05-065-5/+32
| | | | | | | | DW_FORM_line_strp strings come from a separate .debug_line_str section. Make error messages more distinct (no .debug_str, no .debug_line_str or not a string form). Signed-off-by: Mark Wielaard <[email protected]>
* Add support for RISC-VAndreas Schwab2018-04-2313-5/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements initial support for the RISC-V architecture. It has been tested with qemu linux-user emulation <https://build.opensuse.org/package/live_build_log/openSUSE:Factory:RISCV/elfutils/standard/riscv64>, with the following unresolved issues FAIL: run-strip-strmerge.sh =========================== elflint /home/abuild/rpmbuild/BUILD/elfutils-0.170/tests/elfstrmerge section [32] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x51c0 does not match .got section address 0x5010 section [32] '.symtab': symbol 119: st_value out of bounds FAIL run-strip-strmerge.sh (exit status: 1) FAIL: run-elflint-self.sh ========================= section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x6220 does not match .got section address 0x6008 section [33] '.symtab': symbol 135: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/addr2line section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x91d8 does not match .got section address 0x9040 section [33] '.symtab': symbol 163: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elfcmp section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x1a2a0 does not match .got section address 0x1a040 section [33] '.symtab': symbol 267: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xd418 does not match .got section address 0xd0f0 section [33] '.symtab': symbol 238: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/nm section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xa2d0 does not match .got section address 0xa0b0 section [33] '.symtab': symbol 193: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/objdump section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x2e5b8 does not match .got section address 0x2e058 section [33] '.symtab': symbol 410: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/readelf section [32] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x171b8 does not match .got section address 0x17010 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/libelf/libelf.so section [32] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x3a5b0 does not match .got section address 0x3a0d8 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/libdw/libdw.so section [31] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xd0c8 does not match .got section address 0xd008 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/backends/libebl_i386.so section [31] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xf0c8 does not match .got section address 0xf008 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/backends/libebl_x86_64.so FAIL run-elflint-self.sh (exit status: 1) FAIL: run-native-test.sh ======================== /home/abuild/rpmbuild/BUILD/elfutils-0.170/tests/allregs: dwfl_module_register_names: no backend registers known FAIL run-native-test.sh (exit status: 1) FAIL: run-backtrace-native-core.sh ================================== backtrace: backtrace.c:111: callback_verify: Assertion `symname && strcmp (symname, "raise") == 0' failed. ./test-subr.sh: line 84: 26040 Aborted (core dumped) LD_LIBRARY_PATH="${built_library_path}${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" $VALGRIND_CMD "$@" backtrace-child-core.26027: no main rmdir: failed to remove 'test-26016': Directory not empty FAIL run-backtrace-native-core.sh (exit status: 1) In addition, all tests that use ptrace are failing as linux-user emulation does not implement it. There are no regressions for a x86_64 build. Signed-off-by: Andreas Schwab <[email protected]>