public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: dllfixdbg: create .gnu_debuglink section in the right spot
Date: Mon, 15 Nov 2021 12:49:02 +0000 (GMT)	[thread overview]
Message-ID: <20211115124902.7FAAD3858D39@sourceware.org> (raw)

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

commit 3c19e1e0d92f306570187af52f9a00e3324346ec
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Nov 15 13:32:03 2021 +0100

    Cygwin: dllfixdbg: create .gnu_debuglink section in the right spot
    
    A recent change in binutils marks the .gnu_debuglink_overlay section
    as debug section.  When dllfixdbg calls objcopy -g, the section
    is removed and the --add-gnu-debuglink option on the same command line
    appends the section consequentially at the end of the sections.
    This in turn breaks Windows Version info and, potentially, raising
    the cygheap size at runtime.
    
    Fix this by adding an explicit --keep-section=.gnu_debuglink_overlay
    to the objcopy command line.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/dllfixdbg     | 2 +-
 winsup/cygwin/release/3.3.3 | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/dllfixdbg b/winsup/cygwin/dllfixdbg
index 70a496584..a2f1210fd 100755
--- a/winsup/cygwin/dllfixdbg
+++ b/winsup/cygwin/dllfixdbg
@@ -16,7 +16,7 @@ my @objcopy = ((shift));
 my $dll = shift;
 my $dbg = shift;
 xit 0, @objcopy, '-R', '.gnu_debuglink_overlay', '--add-gnu-debuglink=/dev/null', '--only-keep-debug', $dll, $dbg;
-xit 0, @objcopy, '-g', '--add-gnu-debuglink=' . $dbg, $dll;
+xit 0, @objcopy, '-g', '--keep-section=.gnu_debuglink_overlay', '--add-gnu-debuglink=' . $dbg, $dll;
 open(OBJDUMP, '-|', "$objdump --headers $dll");
 my %section;
 while (<OBJDUMP>) {
diff --git a/winsup/cygwin/release/3.3.3 b/winsup/cygwin/release/3.3.3
index d04265181..2ad28d465 100644
--- a/winsup/cygwin/release/3.3.3
+++ b/winsup/cygwin/release/3.3.3
@@ -9,3 +9,6 @@ Bug Fixes
   fstatat and other ...at calls.  "X:/" still is handled as absolute
   path.
   Addresses: https://cygwin.com/pipermail/cygwin/2021-November/249837.html
+
+- Fix showing DLL version info from native Windows tools.
+  Addresses: https://cygwin.com/pipermail/cygwin/2021-November/249867.html


                 reply	other threads:[~2021-11-15 12:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211115124902.7FAAD3858D39@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).