From: Hannes Domani <ssbssa@yahoo.de>
To: "binutils@sourceware.org" <binutils@sourceware.org>,
Hans L <thehans@gmail.com>
Subject: Re: Possible to compress debug symbols in a PE exe? (ld final link failed: bad value)
Date: Tue, 1 Mar 2022 20:50:10 +0000 (UTC) [thread overview]
Message-ID: <2056853532.5544208.1646167811007@mail.yahoo.com> (raw)
In-Reply-To: <CAFoRp-MWfdxF52iMfrrvZCZp1+0yH9uFX76KeFGnCzGuy+5+Cg@mail.gmail.com>
Am Dienstag, 1. März 2022, 21:17:57 MEZ hat Hans L via Binutils <binutils@sourceware.org> Folgendes geschrieben:
> I am cross compiling an application from Linux to Windows, where the build
> uses MXE ( https://mxe.cc/ ) to bootstrap the GCC / Mingw-w64 based
> cross-toolchain, as well as build various library dependencies which get
> statically linked with the final executable.
>
> The application builds successfully under normal conditions, but debug
> builds are much larger than I would like them to be. (About 1GB in size,
> as opposed to 44MB without debug)
> So I wanted to see if compression could help get the filesize down to
> something more reasonable by adding gcc flag "-gz" in my CMakeLists.txt
>
> This results in the build failing on the final step with the message:
> /mxe/usr/bin/x86_64-w64-mingw32.static.posix-ld: final link failed: bad
> value
>
> What is the meaning of this supremely unhelpful error message?
> Is there something about PE format that is not capable of supporting
> compressed DWARF symbols?
> Have I run into a possible bug in ld?
> Or something else entirely is going on? (random guess: must the statically
> linked libraries themselves be built with the same "-gz" flag ?)
I'm not sure why compression while linking isn't working for PE files,
but I am able to compress the final executable with
`objcopy --compress-debug-sections SOME.EXE`, maybe you can use this as well.
Regards
Hannes
prev parent reply other threads:[~2022-03-01 20:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 20:17 Hans L
2022-03-01 20:50 ` Hannes Domani [this message]
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=2056853532.5544208.1646167811007@mail.yahoo.com \
--to=ssbssa@yahoo.de \
--cc=binutils@sourceware.org \
--cc=thehans@gmail.com \
/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).