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
Add support for ELFv2 ABI on big endian ppc64 #8883
Conversation
@dot-asm since there were no changes necessary compared to your original suggestions, maybe you could commit them yourself so I don't have to deal with the CLA stuff? |
Oh! I haven't thought of the CLA thing. I apologize. Well, as far as I recall 'cla-check' can actually be removed manually, so it should be sufficient if I simply state that my CLA effectively covers this. Which I hereby do. Let's give @openssl opportunity to say if they're ok with that, and if not, then I'll resubmit this. |
Perfect, thanks. |
There are two commits in this PR. One is showing the author as @dot-asm, and the other has the author as @q66. If the author of both is actually @dot-asm then please amend the author of the second commit and force push ( |
All done. |
This is a big endian ELFv2 configuration. ELFv2 was already being used for little endian, and big endian was traditionally ELFv1 but there are practical configurations that use ELFv2 with big endian nowadays (Adélie Linux, Void Linux, possibly Gentoo, etc.)
If _CALL_ELF is defined to be 2, it's an ELFv2 system. Conditionally switch to the v2 perlasm scheme.
Rebased against master; any chance of getting this merged? I'll give it another test later. |
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
Ping @openssl/committers. This has been hanging for a bit too long, really |
Alright, I re-ran the testsuite on latest master and it's still okay and passing. |
This is a big endian ELFv2 configuration. ELFv2 was already being used for little endian, and big endian was traditionally ELFv1 but there are practical configurations that use ELFv2 with big endian nowadays (Adélie Linux, Void Linux, possibly Gentoo, etc.) Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from #8883)
If _CALL_ELF is defined to be 2, it's an ELFv2 system. Conditionally switch to the v2 perlasm scheme. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from #8883)
While big endian ppc64 has traditionally used the ELFv1 ABI, it is possible to use the same ELFv2 ABI as on little endian on big endian too. Some distributions are doing this now, too - particularly any big endian distro using the
musl
libc uses ELFv2 unconditionally (e.g. Adélie Linux) andglibc
can also use it (Void Linux provides bothglibc
andmusl
with ELFv2).Previously, compiling OpenSSL with asm on those platforms has resulted in miscompilation and crashes. Fortunately, all that is really necessary is to modify
xlate
to do the same stuff on ELFv2 big endian as on little endian, while keeping the endianness checks in the actual crypto assembly code the same. Whether we're compiling OpenSSL for ELFv1 or ELFv2 can be decided based on the value of the_CALL_ELF
macro in C.All tests are passing. I also re-checked this on little endian just in case, where it also passes.
This fixes #8858.
@dot-asm @awilfox