push %rbx being the first instruction can lead to confusion #11728
-
The following assembly code functions have the push %rbx as the first instruction: sha1_block_data_order https://github.com/openzfs/zfs/blob/master/module/icp/asm-x86_64/sha1/sha1-x86_64.S#L72 Normally it is expected to have the %rbp pushed first, if instead %rbx is pushed first, some stack traversing code may get confused. I got these messages on one of our servers:
Any comment? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This code uses %rbp as a general purpose register, not as the frame pointer. It behaves like gcc with the -fomit-frame-pointer option. So pushing %rbp first won't help since later on %rbp won't point to the previous %rbp. One could add appropriate CFI directives since it seems that the needed DWARF sections are generated for regular (non-debug) build as well. I can have a stab at that if it's deemed important. |
Beta Was this translation helpful? Give feedback.
This code uses %rbp as a general purpose register, not as the frame pointer. It behaves like gcc with the -fomit-frame-pointer option. So pushing %rbp first won't help since later on %rbp won't point to the previous %rbp. One could add appropriate CFI directives since it seems that the needed DWARF sections are generated for regular (non-debug) build as well. I can have a stab at that if it's deemed important.