DWARF5: Don't generate DW_AT_loclists_base for split compile unit DIEs.
commit6aa7b13865c62a4ce3bf7947cc3d55df6a9c2d01
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Jun 2018 23:04:09 +0000 (1 23:04 +0000)
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Jun 2018 23:04:09 +0000 (1 23:04 +0000)
tree574aa96fa969a93677fad15bdcddde56dfc2895d
parentd68ed833bf3242a94884d9d71b00409858551b85
DWARF5: Don't generate DW_AT_loclists_base for split compile unit DIEs.

The loclists_base attribute is used to point to the beginning of the
loclists index of a DWARF5 loclists table when using DW_FORM_loclistsx.
For split compile units the base is not given by the attribute, but is
either the first (and only) index in the .debug_loclists.dwo section,
or (when placed in a .dwp file) given by the DW_SECT_LOCLISTS row in
the .debug_cu_index section.

The loclists_base attribute is only valid for the full (or skeleton)
compile unit DIE in the main (relocatable) object. But GCC only ever
generates a loclists table index for the .debug_loclists section put
into the split DWARF .dwo file.

For split compile unit DIEs it is confusing (and not according to spec)
to also have a DW_AT_loclists_base attribute (which might be wrong,
since its relocatable offset won't actually be relocated).

gcc/ChangeLog

* dwarf2out.c (dwarf2out_finish): Remove generation of
DW_AT_loclists_base.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261092 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/dwarf2out.c