forked from aws/aws-lc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap pointers to s2n-bignum functions - delocator fix (aws#2165)
The original issue was caused by assigning s2n-bignum functions directly to the members of a `methods` struct. This assignment uses `adrp` instructions at the assembly level. The delocator (in FIPS static build) replaces `adrp` with `adr` which has only +/- 1MB range of addressing. In some versions of gcc, the compiled code ends up exceeding that range between the instruction and its target address when it's in another assembly file such as s2n-bignum functions. Wrapping those pointers to s2n-bignum functions does the following - those wrapper functions are closer to where they're assigned to the members `methods` structs because they're in the same compilation unit. - the body of these wrapper functions is simply a `b` branch instruction to the target label. The branch instruction has an address range of +/- 32MB. (The caller of the method member function will be responsible for the link register, i.e. where the control flow will continue when the function returns.)
- Loading branch information
Showing
2 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters