public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: loader script: add DWARF 5 sections
@ 2021-08-27 12:34 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-08-27 12:34 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=801120c1f402f9b0f72b5a231bf9e1cf82614cac

commit 801120c1f402f9b0f72b5a231bf9e1cf82614cac
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Aug 27 14:26:42 2021 +0200

    Cygwin: loader script: add DWARF 5 sections
    
    Modern gcc's generate additional DWARF 5 debug sections, which were
    still missing in our Cygwin loader script.  With ld from binutils 2.37,
    this results in diagnostic output when linking the Cygwin DLL...
    
      ld: cygwin0.dll:/4: section below image base
      ld: cygwin0.dll:/20: section below image base
      ld: cygwin0.dll:/36: section below image base
    
    ...and the section addresses given to these sections (.debug_loclists,
    .debug_rnglists, debug_line_str) will be wrong.
    
    Fix this by adding the missing DWARF 5 sections to our linker script
    template cygwin.sc.in.  Add a comment in terms of the deprecated
    DWARF 4 section .debug_types.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>

Diff:
---
 winsup/cygwin/cygwin.sc.in | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/cygwin.sc.in b/winsup/cygwin/cygwin.sc.in
index 134ae3f76..293d2ab25 100644
--- a/winsup/cygwin/cygwin.sc.in
+++ b/winsup/cygwin/cygwin.sc.in
@@ -178,8 +178,13 @@ SECTIONS
   .debug_typenames ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_typenames) }
   .debug_varnames  ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_varnames) }
   .debug_macro    ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_macro) }
-  /* DWARF 3. */
+  /* DWARF 3 */
   .debug_ranges   ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_ranges) }
-  /* DWARF 4. */
+  /* DWARF 4, merged back into .debug_info with DWARF 5 */
   .debug_types	  ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_types .gnu.linkonce.wt.*) }
+  /* DWARF 5 */
+  .debug_loclists ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_loclists) }
+  .debug_rnglists ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_rnglists) }
+  .debug_line_str ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_line_str) }
+
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-27 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 12:34 [newlib-cygwin] Cygwin: loader script: add DWARF 5 sections Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).