summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-07-20 11:00:33 +0200
committerRichard Biener <rguenther@suse.de>2021-07-20 12:49:59 +0200
commit7cc2df084b7977653a9b59cbc34a9ad500ae619c (patch)
tree034a43aabc9f0ee4ee2653a0f1dfbd015ba50014 /gcc/dwarf2out.h
parent6f79c7845c5ad7f624c1c4180206239b2511da93 (diff)
downloadgcc-7cc2df084b7977653a9b59cbc34a9ad500ae619c.tar.gz
debug/101473 - apply debug prefix maps before checksumming DIEs
The following makes sure to apply the debug prefix maps to filenames before checksumming DIEs to create the global symbol for the CU DIE used by LTO to link the late debug to the early debug. This avoids binary differences (in said symbol) when compiling with toolchains installed under a different path and that compensated with appropriate -fdebug-prefix-map options. The easiest and most scalable way is to record both the unmapped and the remapped filename in the dwarf_file_data so the remapping process takes place at a single point and only once (otherwise it creates GC garbage at each point doing that). 2021-07-20 Richard Biener <rguenther@suse.de> PR debug/101473 * dwarf2out.h (dwarf_file_data): Add key member. * dwarf2out.c (dwarf_file_hasher::equal): Compare key. (dwarf_file_hasher::hash): Hash key. (lookup_filename): Remap the filename and store it in the filename member of dwarf_file_data when creating a new dwarf_file_data. (file_name_acquire): Do not remap the filename again. (maybe_emit_file): Likewise.
Diffstat (limited to 'gcc/dwarf2out.h')
-rw-r--r--gcc/dwarf2out.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
index 057afdb53a0..b2152a53bf9 100644
--- a/gcc/dwarf2out.h
+++ b/gcc/dwarf2out.h
@@ -424,6 +424,7 @@ extern enum dwarf_tag dw_get_die_tag (dw_die_ref);
/* Data about a single source file. */
struct GTY((for_user)) dwarf_file_data {
+ const char * key;
const char * filename;
int emitted_number;
};