summaryrefslogtreecommitdiff
path: root/addr2line.c
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2023-04-18 15:47:54 +1000
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-27 11:25:57 +0900
commitdd406c5a911d2f4a16ce97016666760713540185 (patch)
treee86b5c465ac0d0f1887f543111c3fca6a88b812d /addr2line.c
parent417eb83b48f2e9eb551e8dd5163778c3ef278972 (diff)
downloadruby-dd406c5a911d2f4a16ce97016666760713540185.tar.gz
Skip DW_FORM_GNU_* forms in addr2line.c
DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt refer to data stored in an external ELF file specified by a .gnu_debugaltlink attribute. These attributes are generated by dwz(1), which extracts DWARF data common amongst several files and stores it in a single, new file. It leaves behind these two forms in the original file to point at the new, common data. We don't support actually reading the .gnu_debugaltlink file in addr2line.c (and maybe we don't really need to), but we do need to know how to read the actual value of these forms so we can skip over the right number of bytes and not lose track of where we are in the CU.
Diffstat (limited to 'addr2line.c')
-rw-r--r--addr2line.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/addr2line.c b/addr2line.c
index 1c8de350d9..2f54c14162 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -840,7 +840,11 @@ enum
DW_FORM_addrx1 = 0x29,
DW_FORM_addrx2 = 0x2a,
DW_FORM_addrx3 = 0x2b,
- DW_FORM_addrx4 = 0x2c
+ DW_FORM_addrx4 = 0x2c,
+
+ /* GNU extensions for referring to .gnu_debugaltlink dwz-compressed info */
+ DW_FORM_GNU_ref_alt = 0x1f20,
+ DW_FORM_GNU_strp_alt = 0x1f21
};
/* Range list entry encodings */
@@ -1315,6 +1319,14 @@ debug_info_reader_read_value(DebugInfoReader *reader, uint64_t form, DebugInfoVa
case DW_FORM_addrx4:
set_addr_idx_value(v, read_uint32(&reader->p));
break;
+ /* we have no support for actually reading the real values of these refs out
+ * of the .gnu_debugaltlink dwz-compressed debuginfo at the moment, but "read"
+ * them anyway so that we advance the reader by the right amount. */
+ case DW_FORM_GNU_ref_alt:
+ case DW_FORM_GNU_strp_alt:
+ read_uint(reader);
+ set_uint_value(v, 0);
+ break;
case 0:
goto fail;
break;