-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use llvm-objcopy on Linux x64 #48444
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
cc @janvorli |
@am11 what effect does this discrepancy have on debugging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Hello @janvorli! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
@janvorli, I am not aware of any direct effect on debugging; was embedding the symbols (with Ideally, we should be using all tools of the same toolchain, but currently we have some older versions to support so it requires a lot of back and forth testing. I guess we can more conveniently align this in future, when we will deprecate older versions of cross toolchain. |
This reverts commit ba50840.
This reverts commit ba50840.
Consider the following commands sequence for symbol stripping:
runtime/eng/native/functions.cmake
Lines 291 to 293 in 77c939c
Before and after line 291, the clang-compiled libcoreclr.so on Linux x64 has
.init_array
and.fini_array
with ES value (sh_entsize; /* Entry size if section holds table */
) set to0
(zero):(the gcc-compiled version has ES value of
8
(eight) for these two symbols here)After line 292, the clang-compiled libcoreclr.so gets the ES value changed to
8
(eight) but now the libcoreclr.so.dbg has the ES value0
(zero) for those symbols. This is because we are using GNU's objcopy instead of LLVM's, and this causes a mismatch between symbols and binary.This was found with symbol unstripping-then-stripping roundtrip test:
This PR makes it so we use objcopy out of llvm-toolchain when compiling with clang for relevant x64 ELF targets, and continue to use GNU's objcopy for gcc. With this change, both symbols and binary have ES values
0
(zero) for the said symbols. With gcc, the value is8
(eight) in both SO and DBG before and after this change (and before and after the strip roundtrip).