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>
This commit is contained in:
Corinna Vinschen 2021-11-15 13:32:03 +01:00
parent df5de02e0e
commit 98d10e5fd2
2 changed files with 4 additions and 1 deletions

View File

@ -16,7 +16,7 @@ my @objcopy = ((shift));
my $dll = shift; my $dll = shift;
my $dbg = shift; my $dbg = shift;
xit 0, @objcopy, '-R', '.gnu_debuglink_overlay', '--add-gnu-debuglink=/dev/null', '--only-keep-debug', $dll, $dbg; 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"); open(OBJDUMP, '-|', "$objdump --headers $dll");
my %section; my %section;
while (<OBJDUMP>) { while (<OBJDUMP>) {

View File

@ -9,3 +9,6 @@ Bug Fixes
fstatat and other ...at calls. "X:/" still is handled as absolute fstatat and other ...at calls. "X:/" still is handled as absolute
path. path.
Addresses: https://cygwin.com/pipermail/cygwin/2021-November/249837.html 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