Skip to content

llvm-objcopy's --compress-debug-sections doesn't work #553

Description

@hukeyue

Passed with option --compress-debug-sections

➜  build-mingw-x86_64 git:(develop) ✗ /Users/keeyou/yass-develop/third_party/llvm-build/Release+Asserts/bin/llvm-objcopy --only-keep-debug --compress-debug-sections yass.exe yass.exe.dbg
➜  build-mingw-x86_64 git:(develop) ✗ ls -alh yass.exe*
-rwxr-xr-x  1 keeyue  staff    45M Apr  6 09:05 yass.exe
-rwxr-xr-x  1 keeyue  staff    44M Apr  6 09:15 yass.exe.dbg

Passed without option --compress-debug-sections

➜  build-mingw-x86_64 git:(develop) ✗ rm yass.exe.dbg
➜  build-mingw-x86_64 git:(develop) ✗ /Users/keeyou/yass-develop/third_party/llvm-build/Release+Asserts/bin/llvm-objcopy --only-keep-debug yass.exe yass.exe.dbg
➜  build-mingw-x86_64 git:(develop) ✗ ls -alh yass.exe*
-rwxr-xr-x  1 keeyue  staff    45M Apr  6 09:05 yass.exe
-rwxr-xr-x  1 keeyue  staff    44M Apr  6 09:15 yass.exe.dbg
➜  build-mingw-x86_64 git:(develop) ✗ ~/clang+llvm-22.1.2-arm64-apple-darwin20.1.0/bin/llvm-objdump --all-headers yass.exe.dbg > yass.exe.dbg.headers.txt
➜  build-mingw-x86_64 git:(develop) ✗ /Users/keeyou/yass-develop/third_party/llvm-build/Release+Asserts/bin/llvm-objcopy --only-keep-debug --compress-debug-sections yass.exe yass.exe.dbg
➜  build-mingw-x86_64 git:(develop) ✗ ~/clang+llvm-22.1.2-arm64-apple-darwin20.1.0/bin/llvm-objdump --all-headers yass.exe.dbg > yass.exe.dbg.headers.with-compress.txt
➜  build-mingw-x86_64 git:(develop) ✗ diff yass.exe.dbg.headers.with-compress.txt yass.exe.dbg.headers.txt
➜  build-mingw-x86_64 git:(develop) ✗ echo $?
0

yass.exe.dbg.headers.txt
yass.exe.dbg.headers.with-compress.txt

BTW option --extract-dwo doesn't work as well:

➜  build-mingw-x86_64 git:(develop) ✗ /Users/keeyou/yass-develop/third_party/llvm-build/Release+Asserts/bin/llvm-objcopy --extract-dwo yass.exe yass.dwo
/Users/keeyou/yass-develop/third_party/llvm-build/Release+Asserts/bin/llvm-objcopy: error: option is not supported for COFF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions