Skip to content
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

removes section and other symbols in ELF #1220

Merged

Conversation

ivg
Copy link
Member

@ivg ivg commented Sep 14, 2020

Apparently, we were running our tests on LLVM 6, not LLVM 9 as we used to believe. This PR switches to LLVM 9 for running tests and fixes a bug that was not present in LLVM 6 and below (it could be that it appears before 9 though). The problem was in the emission of section symbols from the eh_frame section, which apparently should represent call frames, so it is not obvious to me why they are tagged as STT_SECTION that is mapped to LLVM's ST_Debug. It is unclear what those symbols encode, but is quite obvious that llvm misinterprets them as at the end of the day we have a bunch of symbols named .text that hides the real symbols. This PR prevents the emission of such symbols, as well as other symbols, such as file, object, and abi-specific symbols, as we don't really know the interpretation of their fields.

This PR also removes the LLVM 6 dependency from our CI file as well as makes changing the llvm version more straightforward when the omake backend is used, e.g.,

./configure-omake --with-llvm-version=9 --with-llvm-config=llvm-config-9

Yes, it is awkward but you have to specify both the version and llvm-config path.

We already have llvm-9 installed so there is no reason to install the
default llvm also.
though careful many of the options will be just ignored, either by the
script or by oasis/omake intergration.

Use the new feature immediately in the build-and-test action to enable
tests and specify the llvm version (which is for now ignored, but see
the next commit).
This is much better than specifying them manually as we did before :)

Also, switches back to the static linking with llvm when omake is
used.
@ivg ivg force-pushed the switches-to-llvm-9-in-omake-build branch from b71b58e to b0a0649 Compare September 14, 2020 21:09
The section symbols confuse our symbolization procedure so that at the
end we get symbols named as `.text` instead of their real names. To
prevent this, we are not emitting anymore relocation information about
symbols that are sections, files, objects, and other non-functions.

This commit fixes the nightly regression test. The underlying issue is
triggered only on modern LLVM (e.g., it is not observable on LLVM 6
and before, but is definitely triggered on 9, not sure about the in
between versions).
@ivg ivg changed the title Switches to llvm 9 in omake build removes section and other symbols in ELF Sep 15, 2020
@ivg ivg merged commit 6c50124 into BinaryAnalysisPlatform:master Sep 15, 2020
@ivg ivg deleted the switches-to-llvm-9-in-omake-build branch December 1, 2021 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant