| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
mingw should have complained about this, too ...
Change-Id: I03940ba6e93ef04c51418cc507cccf47453d10fa
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
We want to link libdl statically, so we need to link psapi ourselves.
Change-Id: I001bda009c58cfb39bba0733436f883bbf501b80
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
| |
Change-Id: Ie9cf00b2e00b84ab736aaefc805a1cacfc9ae408
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
The windows linker looks for .dll files in PATH. LD_LIBRARY_PATH doesn't
work. This reduces the amount of headache to be suffered when running the
test suite.
Change-Id: I94e73af46bf4a7b185158067db86a9c16f3690dd
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
| |
I don't think we can accidentally match these strings in any other place
and the line ending matches are brittle.
Change-Id: I880e23a89c56851b17e50d804ed949761c9c1955
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
We are relying on the version of grep being used to recognize the platform
specific line endings. In principle it should, but the reality turns out
to be ... complicated. This message is unique enough to not require the
additional qualification of "at end of line".
Change-Id: I8241b023e759c9b57e050b07995cad0683c4bf35
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
On windows, strip cannot overwrite files.
Change-Id: I2cf1384b18daec71f079238cf274bce08bdc209b
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
| |
There are some convenient new methods for selftests that we can hook into
to avoid repeating the same check in every test.
Change-Id: Ie12e1f90f86f3bd3f0590fef4fe0157f4bc0f59c
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
Windows needs that if you're not reading text.
Change-Id: I923782f2c47ef16765f52d6a435f69cb33f50dfd
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
Also document CONFIG_DEBUG_INFO=y.
Updated test file provided by Andreas Schwab <[email protected]>.
Change-Id: I1bf3deaf1ec0883f345b232bc4ceb56601f5bf79
Reviewed-by: Christian Kandeler <[email protected]>
|
| |\
| |
| |
| |
| |
| | |
elfutils 0.173 release
Change-Id: I83dc56dd15c26fe7acf4ce73c29df65b8b65e757
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the length is zero this is a the zero terminator that ends the
frame table. Return 1 (end of table) instead of -1 (error) in that case.
We cannot update next_off and don't want to caller to try again.
Add testcase for dwarf_next_cfi to show both .eh_frame and .debug_frame
tables and check consistency (FDEs should point to existing CIEs).
Also add a self check to make sure we can read the table from the just
build elfutils binaries.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
.debug_frame is useful independent from the other .debug sections.
Add a simplified variant of the addrcfi testcase dwarfcfi.
dwarfcfi only uses dwarf_frame calls and no dwfl helpers.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This is only useful for bad DWARF where an expression block might have
an expression that refers to a DIE that contains the expression block
itself. But that might happen with bad DWARF generated by a fuzzer.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It is sometimes useful to read .debug_line tables on their own without
having an associated CU DIE. DWARF5 line tables are self-contained.
Adjust dwarf_begin_elf to accept ELF files with just a .debug_line.
Add a new function dwarf_next_lines that returns the Dwarf_Files and
Dwarf_Lines while iterating over just the .debug_lines section. Since
we parse and cache the information it also will try to match the CU
a table is associated with. This is only necessary for DWARF4 line
tables (we will need at least the compilation dir from the CU) and
won't be done for DWARF5 line tables. It also isn't an error if there
is no associated CU (but will mean for DWARF4 line tables the dir list
and the file paths might not be complete).
A typical way to call this new function is:
Dwarf_Off off, next_off = 0;
Dwarf_CU *cu = NULL;
Dwarf_Files *files;
size_t nfiles;
Dwarf_Lines *lines;
size_t nlines;
int res;
while ((res = dwarf_next_lines (dbg, off = next_off, &next_off, &cu,
&files, &nfiles, &lines, &nlines)) == 0)
{
/* ... handle files and lines ... */
}
if (res < 0)
printf ("BAD dwarf_next_lines: %s\n", dwarf_errmsg (-1));
See libdw.h for the full documentation. For more examples on how to use
the function see the new testcases next-files and next-lines.
Also adjust the file paths for line tables missing a comp_dir.
They are no longer made "absolute" by prepending a slash '/' in front
of them. This really was not useful and didn't happen in any of the
testcases. They are now just kept relative.
Make eu-readelf --debug-dump=decodedline use dwarf_next_lines instead
of iterating over the CUs to show the (decoded) line tables. This allows
it to show decoded line tables even if there is no .debug_info section.
New tests have been added that mimic the get-files and get-lines tests
but use dwarf_next_lines instead of iterating over all CUs. They produce
identical output (modulo the CU information). Also add a new test file
that contains only a .debug_line section.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Due to libdw does not have proper BPF relocation support,
the pahole cannot display filenames correctly for objects
with default llvm options. So we have to invent
a special option "llc -march=bpf -mattr=dwarfris" to
prevent llvm from generating cross-section dwarf relocation
records (https://reviews.llvm.org/rL326505).
The pahole related discussion is in linux netdev
mailing list (http://lists.openwall.net/netdev/2018/06/15/38, etc.)
We would like to add proper BPF relocation support
to libdw so eventually we could retire the special llc bpf
flag "-mattr=dwarfris".
The bpf relocations are defined in
llvm_repo:include/llvm/BinaryFormat/ELFRelocs/BPF.def:
ELF_RELOC(R_BPF_NONE, 0)
ELF_RELOC(R_BPF_64_64, 1)
ELF_RELOC(R_BPF_64_32, 10)
Removed the relocation type R_BPF_MAP_FD whoes name does not
confirm to llvm definition and replaced it with R_BPF_64_64.
The BPF object is just a relocatible object, not an executable or
a shared library, so assign ELF type to REL only in bpf_reloc.def.
Signed-off-by: Yonghong Song <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We only handles DW_FORM_sdata as a signed form, but DW_FORM_implicit_const
is also signed by default. For DW_AT_const_value we can do a little better.
GCC encodes some const_values with signed forms, even though the type
is unsigned. Lookup the (base) type of the DIE and display the const value
as their (signed) type/size (if we can determine that).
Add a new testcase run-readelf-const-values.sh that shows that.
With the new testcase the const values would come out as follows:
name (string) "i"
const_value (implicit_const) 18446744073709551615
name (string) "j"
const_value (implicit_const) 18446744073709551615
name (string) "sc"
const_value (sdata) -2
name (string) "uc"
const_value (sdata) -2
name (string) "ss"
const_value (sdata) -16
name (string) "us"
const_value (sdata) -16
name (string) "si"
const_value (sdata) -3
name (string) "ui"
const_value (sdata) -94967296
name (string) "sl"
const_value (sdata) -1
name (string) "ul"
const_value (sdata) -1
With this patch they show up as:
name (string) "i"
const_value (implicit_const) -1
name (string) "j"
const_value (implicit_const) -1
name (string) "sc"
const_value (sdata) -2
name (string) "uc"
const_value (sdata) 254 (-2)
name (string) "ss"
const_value (sdata) -16
name (string) "us"
const_value (sdata) 65520 (-16)
name (string) "si"
const_value (sdata) -3
name (string) "ui"
const_value (sdata) 4200000000 (-94967296)
name (string) "sl"
const_value (sdata) -1
name (string) "ul"
const_value (sdata) 18446744073709551615 (-1)
(for signed/unsigned int char, short and long)
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
If the target of a DW_OP_GNU_parameter_ref isn't a DW_TAG_formal_parameter
that is bad data (which varlocs should error on). But it isn't an internal
consistency check (for which varlocs should assert).
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
It is only a consistency issue if we actually have an cfi_debug and the
cfi_debug_bias is not zero (because they come from the same file as the
other debug data).
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We don't really need to setup a buffer, print into it and then print it
out to stdout. Simplify the code by directly printing the address (and
symbol name).
This also showed a small error in the output of DW_LLE_startx_length.
It had two unintended trailing dots.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
When using the varlocs test with a fuzzer using assert for internal
sanity checks is great to find issues. But when encountering bad data
using an assert is wrong. Just use error to show we handle the data
correctly (by reporting it is bad, instead of crashing).
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 00d89086 "tests: Split self_test_files into an exe, lib and obj
list" accidentially left the shared libraries in the self_test_files_exe.
Causing all shared libraries to be tested twice. Drop them and keep just
four ET_EXE files: addr2line, elfcmp, objdump and readelf.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| | |
Test that the low high pc attributes can be properly resolved also
in split dwarf setups.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This testcase tests the fix for the readelf --debug-dump=line bug fixed
in commit 40b1f18 "readelf: Fix advance_pc to use op_addr_advance, not
just op_advance."
This tests both the --debug-dump=line (readelf) implementation and the
--debug-dump=decodedline (libdw) implementation. The first fails without
the bug fix. The second was already correct.
Signed-off-by: Mark Wielaard <[email protected]>
|