0

In the process of my work, I need to build Linux versions of our codebase & release. The toolchain is LLVM/clang. I also have GNU tools installed on my system. I sometimes need to strip symbols out of .so's, using

objcopy --only-keep-debug libraryname.so libraryname.pdb
objcopy --strip-debug libraryname.so

However, this uses /usr/bin/objcopy on my PC, which the GNU version. If I use llvm-objcopy, I see different size file results for both the resulting symbol-only and no-symbol .so files. Using either stripped .so file in my executable appears to not make a difference.

So the question: Are there any known incompatibilities when using GNU objcopy when the .so was created with clang? Is there any guidance on this use by the LLVM project?

asked Aug 6, 2025 at 14:59
2
  • @Mike'Pomax'Kamermans not looking for a legal opinion here - just a technical explanation. Commented Aug 6, 2025 at 15:22
  • They're just files. As long as the file format matches the standard, it doesn't matter what tools made them or process them. It's not like they carry the manufacturer's UPC code somewhere. Commented Aug 6, 2025 at 18:07

1 Answer 1

2

Based on this thread from the LLVM Discussions Board, the goal for LLVM binutils is to maintain as much compatibility as possible with their GNU equivalents:

"be gnu compatible, except when it doesn’t make sense" – support for ancient platforms, bugs, weird formatting, etc.

Also, comparing the headers of the 2 .so's gives the same results, and a cursory compare of their disassemblies shows equivalence as well. So while not definitive, it appears the answer is Yes.

answered Aug 6, 2025 at 18:15
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.