George Rimar 64091d5626 [ELF] - Also use DW_AT_linkage_name when gathering information about variables for error messages.
Currently, when LLD do a lookup for variables location, it uses DW_AT_name attribute.
That is not always enough.

Imagine code:

namespace A {
  int bar = 0;
}

namespace Z {
  int bar = 1;
}

int hoho;
In this case there are 3 variables and their debug attributes are following:

A::bar has: DW_AT_name [DW_FORM_string] ("bar") DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x00000006] = "_ZN1A3barE")
Z::bar has: DW_AT_name [DW_FORM_string] ("bar") DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x0000003f] = "_ZN1Z3barE")
hoho has: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004a] = "hoho") and has NO DW_AT_linkage_name attribute. Because it would be
the same as DW_AT_name and DWARF producers avoids emiting excessive data.

Hence LLD should also use DW_AT_linkage_name when it is available.
(currently, LLD fails to report location correctly because thinks that A::bar and Z::bar are the same things)

Differential revision: https://reviews.llvm.org/D47373

llvm-svn: 333880
2018-06-04 10:28:45 +00:00
..
2018-04-24 09:55:39 +00:00
2018-05-31 13:24:01 +00:00
2018-03-30 23:13:00 +00:00
2017-10-27 03:14:09 +00:00
2018-04-10 13:15:21 +00:00
2017-11-17 08:17:21 +00:00
2018-02-12 21:56:14 +00:00
2018-05-23 16:51:23 +00:00
2018-03-14 20:29:45 +00:00
2016-03-12 06:06:40 +00:00
2017-12-26 10:13:10 +00:00
2018-05-21 18:12:46 +00:00
2018-04-27 05:50:40 +00:00

See docs/NewLLD.rst