poly1305/asm/poly1305-armv4.pl: avoid conditional branch to PLT in THUMB-2#5949
poly1305/asm/poly1305-armv4.pl: avoid conditional branch to PLT in THUMB-2#5949rahulchaudhry wants to merge 1 commit intoopenssl:masterfrom rahulchaudhry:master
Conversation
There was a problem hiding this comment.
I'd like to suggest (which is basically euphemism for insist:-) on removing this relocation altogether. I mean suggested change replaces one relocation type with another, but why have relocation at all if we can get rid of it? So drop #ifdef, beq .Lpoly1305_blocks and add .Lpoly1305_blocks: right after poly1305_blocks:.
…UMB-2. When compiling for THUMB-2, the conditional branch to PLT results in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation in THUMB-2 (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable poly1305 optimization assembly, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/beab607d2b1ff23c41b7e01aa9c64be5e247d1e6 CLA: trivial
|
Editorial note. I'd say that "remove unintentional relocation" would be more appropriate subject. Because modification doesn't affect Thumb-2 exclusively and original subject is too "tech". I mean not everybody keeps those abbreviations in "Level 1 cache" of their brains. I would also modify description as "conditional branch to global symbol results in reference to PLT and a R_ARM_THM_JUMP19 relocation". You don't have to do anything, I can do it upon commit to repo. |
|
Thanks |
|
Ping for 2nd review. |
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable poly1305 optimization assembly, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/beab607d2b1ff23c41b7e01aa9c64be5e247d1e6 CLA: trivial Reviewed-by: Andy Polyakov <[email protected]> Reviewed-by: Rich Salz <[email protected]> (Merged from #5949)
Branch to global symbol results in reference to PLT, and when compiling for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation (ld.gold), while others can end up truncating the relocation to fit (ld.bfd). Convert this branch through PLT into a direct branch that the assembler can resolve locally. See android/ndk#337 for background. The current workaround is to disable poly1305 optimization assembly, which is not optimal and can be reverted after this patch: https://github.com/freedesktop/gstreamer-cerbero/commit/beab607d2b1ff23c41b7e01aa9c64be5e247d1e6 CLA: trivial Reviewed-by: Andy Polyakov <[email protected]> Reviewed-by: Rich Salz <[email protected]> (Merged from #5949) (cherry picked from commit 5bb1cd2)
|
Merged. Thanks! |
When compiling for THUMB-2, the conditional branch to PLT results in a
R_ARM_THM_JUMP19 relocation. Some linkers don't support this relocation
in THUMB-2 (ld.gold), while others can end up truncating the relocation
to fit (ld.bfd).
Adding an "it eq" before the branch converts it into an unconditional
branch, which uses R_ARM_THM_JUMP24 relocation that has a range of 16MB.
See android/ndk#337 for background.
The current workaround is to disable poly1305 optimization assembly,
which is not optimal and can be reverted after this patch:
https://github.com/freedesktop/gstreamer-cerbero/commit/beab607d2b1ff23c41b7e01aa9c64be5e247d1e6
CLA: trivial