Query about compressed_debug_sections for mingw platform

vri vri zxyvri@gmail.com
Sun Dec 24 12:16:12 GMT 2023


 Hello,

I see that the linker ld dosent support compressed_debug_sections but
objcopy supports compressed_debug_sections for mingw platform. Is it
possible to support compressed_debug_sections with the ld linker. Details
about the objcopy and ld binaries are as follows

```
$ /ucrt64/bin/ld --version

GNU ld (GNU Binutils) 2.41
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ /ucrt64/bin/ld --help | grep compress
<no_output>

```

```

$ objcopy --version
GNU objcopy (GNU Binutils) 2.41
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
$ objcopy --help | grep compress
     --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi|zstd}]
     --decompress-debug-sections   Decompress DWARF debug sections using zlib

```

I also verifed that I am able to use --compress-debug-sections on a hello
world binary compiled from rust like below

```

$ cargo new hello_world
$ cargo +stable-gnu build
$ ./target/debug/hello_world.exe
Hello, world!
$ objcopy --compress-debug-sections target/debug/hello_world.exe
hello_world_compress
$ ./hello_world_compress
Hello, world!
$ ls -lah ./hello_world_compress target/debug/hello_world.exe
-rwxr-xr-x 1 user user 2.4M Dec 24 16:56 ./hello_world_compress
-rwxr-xr-x 2 user user 5.4M Dec 24 16:54 target/debug/hello_world.exe

```

Thanks for the help in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20231224/a9190e55/attachment.htm>


More information about the Binutils mailing list