]> gcc.gnu.org Git - gcc.git/commitdiff
DWARF5: Don't generate DW_AT_loclists_base for split compile unit DIEs.
authorMark Wielaard <mark@klomp.org>
Fri, 1 Jun 2018 23:04:09 +0000 (23:04 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Fri, 1 Jun 2018 23:04:09 +0000 (23:04 +0000)
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.

From-SVN: r261092

gcc/ChangeLog
gcc/dwarf2out.c

index 427945d5fff3372a8f39f0dec35a716cf1092e80..3278823415cb9e12159e1dfa906697ac6a98df6f 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-01  Mark Wielaard  <mark@klomp.org>
+
+       * dwarf2out.c (dwarf2out_finish): Remove generation of
+       DW_AT_loclists_base.
+
 2018-06-01  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gimple-ssa-store-merging.c: Include gimple-fold.h.
index 3a24225690de1b054ac2ca850176205a7d648154..e3d24e86c1512bd47ea2cfa09e8c5eb39f19f254 100644 (file)
@@ -31297,9 +31297,15 @@ dwarf2out_finish (const char *)
     {
       if (have_location_lists)
        {
-         if (dwarf_version >= 5)
-           add_AT_loclistsptr (comp_unit_die (), DW_AT_loclists_base,
-                               loc_section_label);
+         /* Since we generate the loclists in the split DWARF .dwo
+            file itself, we don't need to generate a loclists_base
+            attribute for the split compile unit DIE.  That attribute
+            (and using relocatable sec_offset FORMs) isn't allowed
+            for a split compile unit.  Only if the .debug_loclists
+            section was in the main file, would we need to generate a
+            loclists_base attribute here (for the full or skeleton
+            unit DIE).  */
+
          /* optimize_location_lists calculates the size of the lists,
             so index them first, and assign indices to the entries.
             Although optimize_location_lists will remove entries from
This page took 0.119777 seconds and 5 git commands to generate.