Add DWARF 5 debug sections to PE* scripts.

Message ID 20210218174349.797-1-ssbssa@yahoo.de
State New
Headers show
Series
  • Add DWARF 5 debug sections to PE* scripts.
Related show

Commit Message

Nick Clifton via Binutils Feb. 18, 2021, 5:43 p.m.
ld/ChangeLog:

2021-02-18  Hannes Domani  <ssbssa@yahoo.de>

	PR binutils/27268
	* scripttempl/pe.sc: Add DWARF 5 sections.
	* scripttempl/pep.sc: Likewise.
---
 ld/scripttempl/pe.sc  | 82 ++++++++++++++++++++++++++++++++++++++-----
 ld/scripttempl/pep.sc | 82 ++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 146 insertions(+), 18 deletions(-)

-- 
2.30.1

Comments

Fangrui Song Feb. 18, 2021, 7:33 p.m. | #1
On Thu, Feb 18, 2021 at 9:43 AM Hannes Domani via Binutils
<binutils@sourceware.org> wrote:
>

> ld/ChangeLog:

>

> 2021-02-18  Hannes Domani  <ssbssa@yahoo.de>

>

>         PR binutils/27268

>         * scripttempl/pe.sc: Add DWARF 5 sections.

>         * scripttempl/pep.sc: Likewise.

> ---

>  ld/scripttempl/pe.sc  | 82 ++++++++++++++++++++++++++++++++++++++-----

>  ld/scripttempl/pep.sc | 82 ++++++++++++++++++++++++++++++++++++++-----

>  2 files changed, 146 insertions(+), 18 deletions(-)


We may not need .zdebug_* as zlib-gnu has been obsoleted.
.debug_sup is not used by linkers, so is technically not needed as well.
Nick Clifton via Binutils Feb. 24, 2021, 11:45 a.m. | #2
Am Donnerstag, 18. Februar 2021, 20:34:04 MEZ hat Fangrui Song <i@maskray.me> Folgendes geschrieben:

> On Thu, Feb 18, 2021 at 9:43 AM Hannes Domani via Binutils

>

> <binutils@sourceware.org> wrote:

> >

> > ld/ChangeLog:

> >

> > 2021-02-18  Hannes Domani  <ssbssa@yahoo.de>

> >

> >        PR binutils/27268

> >        * scripttempl/pe.sc: Add DWARF 5 sections.

> >        * scripttempl/pep.sc: Likewise.

> > ---

> >  ld/scripttempl/pe.sc  | 82 ++++++++++++++++++++++++++++++++++++++-----

> >  ld/scripttempl/pep.sc | 82 ++++++++++++++++++++++++++++++++++++++-----

> >  2 files changed, 146 insertions(+), 18 deletions(-)

>

>

> We may not need .zdebug_* as zlib-gnu has been obsoleted.


If the .zdebug_* are not needed anymore, they should probably be removed in
an extra commit.


> .debug_sup is not used by linkers, so is technically not needed as well.


Should I send a v2 without .debug_sup?


Hannes

Patch

diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc
index 4617c05ff0c..3917194d3ef 100644
--- a/ld/scripttempl/pe.sc
+++ b/ld/scripttempl/pe.sc
@@ -410,15 +410,6 @@  SECTIONS
     *(.zdebug_varnames)
   }
 
-  .debug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
-  {
-    *(.debug_macro)
-  }
-  .zdebug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
-  {
-    *(.zdebug_macro)
-  }
-
   /* DWARF 3.  */
   .debug_ranges ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
   {
@@ -439,6 +430,79 @@  SECTIONS
     *(.zdebug_types${RELOCATING+ .gnu.linkonce.wt.*})
   }
 
+  /* DWARF 5.  */
+  .debug_addr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_addr)
+  }
+  .zdebug_addr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_addr)
+  }
+
+  .debug_line_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_line_str)
+  }
+  .zdebug_line_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_line_str)
+  }
+
+  .debug_loclists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_loclists)
+  }
+  .zdebug_loclists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_loclists)
+  }
+
+  .debug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_macro)
+  }
+  .zdebug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_macro)
+  }
+
+  .debug_names ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_names)
+  }
+  .zdebug_names ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_names)
+  }
+
+  .debug_rnglists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_rnglists)
+  }
+  .zdebug_rnglists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_rnglists)
+  }
+
+  .debug_str_offsets ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_str_offsets)
+  }
+  .zdebug_str_offsets ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_str_offsets)
+  }
+
+  .debug_sup ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_sup)
+  }
+  .zdebug_sup ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_sup)
+  }
+
   /* For Go and Rust.  */
   .debug_gdb_scripts ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
   {
diff --git a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc
index 7363205bab7..d6b1c51fbd6 100644
--- a/ld/scripttempl/pep.sc
+++ b/ld/scripttempl/pep.sc
@@ -415,15 +415,6 @@  SECTIONS
     *(.zdebug_varnames)
   }
 
-  .debug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
-  {
-    *(.debug_macro)
-  }
-  .zdebug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
-  {
-    *(.zdebug_macro)
-  }
-
   /* DWARF 3.  */
   .debug_ranges ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
   {
@@ -444,6 +435,79 @@  SECTIONS
     *(.zdebug_types${RELOCATING+ .zdebug.gnu.linkonce.wt.*})
   }
 
+  /* DWARF 5.  */
+  .debug_addr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_addr)
+  }
+  .zdebug_addr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_addr)
+  }
+
+  .debug_line_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_line_str)
+  }
+  .zdebug_line_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_line_str)
+  }
+
+  .debug_loclists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_loclists)
+  }
+  .zdebug_loclists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_loclists)
+  }
+
+  .debug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_macro)
+  }
+  .zdebug_macro ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_macro)
+  }
+
+  .debug_names ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_names)
+  }
+  .zdebug_names ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_names)
+  }
+
+  .debug_rnglists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_rnglists)
+  }
+  .zdebug_rnglists ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_rnglists)
+  }
+
+  .debug_str_offsets ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_str_offsets)
+  }
+  .zdebug_str_offsets ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_str_offsets)
+  }
+
+  .debug_sup ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.debug_sup)
+  }
+  .zdebug_sup ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    *(.zdebug_sup)
+  }
+
   /* For Go and Rust.  */
   .debug_gdb_scripts ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
   {