https://sourceware.org/bugzilla/show_bug.cgi?id=32732

            Bug ID: 32732
           Summary: Binutils (objcopy) generates abnormally large,
                    non-functional binaries
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: basjetimmer at yahoo dot com
  Target Milestone: ---

Since version 2.43, mingw-w64-binutils has been causing some binaries to
balloon in size and not function.

Up until 2.42 (tested from 2.39 up), when building mingw-w64-openssl, the
resulting libraries show:

   
[~/binutils_issue/built_with_2.42/mingw-w64-openssl-3.4.1-1-any.pkg.tar.zst/usr/x86_64-w64-mingw32/lib]
$  ls -l
    total 13575
    drwxr-xr-x 1 root root       1 feb 17 11:05 cmake
    drwxr-xr-x 1 root root       1 feb 17 11:05 engines-3
    -rw-r--r-- 1 root root 8145216 feb 17 11:05 libcrypto.a
    -rwxr-xr-x 1 root root 3872194 feb 17 11:05 libcrypto.dll.a
    -rw-r--r-- 1 root root 1477594 feb 17 11:05 libssl.a
    -rwxr-xr-x 1 root root  402536 feb 17 11:05 libssl.dll.a
    drwxr-xr-x 1 root root       1 feb 17 11:05 ossl-modules
    drwxr-xr-x 1 root root       1 feb 17 11:05 pkgconfig

After updating to 2.43 and recompiling mingw-w64-openssl, the libraries are
enormous. Especially libcrypto.dll.a has grown from 3.7M to about 115M:

   
[~/binutils_issue/built_with_2.43/mingw-w64-openssl-3.4.1-1-any.pkg.tar.zst/usr/x86_64-w64-mingw32/lib]
$  ls -l
    total 158762
    drwxr-xr-x 1 root root         1 feb 17 11:14 cmake
    drwxr-xr-x 1 root root         1 feb 17 11:14 engines-3
    -rw-r--r-- 1 root root  26922052 feb 17 11:14 libcrypto.a
    -rwxr-xr-x 1 root root 119957566 feb 17 11:14 libcrypto.dll.a
    -rw-r--r-- 1 root root   3341982 feb 17 11:14 libssl.a
    -rwxr-xr-x 1 root root  12347196 feb 17 11:14 libssl.dll.a
    drwxr-xr-x 1 root root         1 feb 17 11:14 ossl-modules
    drwxr-xr-x 1 root root         1 feb 17 11:14 pkgconfig

Additionally, a program I regularly link against the openssl libraries has also
more than doubled in size and - more importantly - refuses to run on Windows
anymore.

After some useful comments on the mailing list, I was directed to the following
commit in objcopy:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=121a3f4b4f4;hp=b35013e29f3bcf9028aa22291f378010420322fe

Undoing this single commit in the 2.43 tree makes all problems disappear.

While I am a bit out of my depth here, I'm willing to answer any questions, run
any commands, test any patches as needed.

References:
Possibly helpful mailing list messages:
https://sourceware.org/pipermail/binutils/2025-February/139517.html
https://sourceware.org/pipermail/binutils/2025-February/139519.html

A github page I used to host the built packages (with and without issues) and
describe the problem (and solution):
https://github.com/bepaald/binutils_issue

Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to