Conversation
Zicfilp has provided two labeling schemes: simple and complex (also known as function signature-based). The simple scheme uses an lpad with a constant 0, which does not require any hashing mechanism. In contrast, the complex labeling scheme computes the MD5 hash from the signature string. Filling up an MD5 hash value is straightforward for compilers, but it is non-trivial work for humans to maintain. Therefore, we have added new assembler modifiers to compute this value. See also: riscv/riscv-cfi#151
| Push/pop current options to/from the options stack. | ||
|
|
||
| ## Assembler Relocation Functions | ||
| ## Assembler Modifiers |
There was a problem hiding this comment.
This term is learned from GNU as manual https://sourceware.org/binutils/docs/as/RISC_002dV_002dModifiers.html
|
Actually, I wonder if this would turn out to be useful, since the function signature string format is (for now) drafted to be the mangled string of the function type, which IMHO is not human-friendly enough to be written/read correctly by a human programmer. Also, AFAIK, there's no convenient tool to mangle function signatures to strings, despite the widespread usage of To get a feel: Though I doubt the usefulness of this |
Should we add a modifier that takes the function prototype string instead of mangled string as input - like %lpad_hash_proto("void (*f)(int, char)"). |
I guess this would be a huge effort for assemblers to implement, since they do not know anything about the C/C++ language, so the corresponding C parser and C++ mangler would need to be pulled in, which is a big cost for a minor convenient feature like this. |
| The hash result is obtained from the lower 20 bits of the MD5 result of the | ||
| string. |
There was a problem hiding this comment.
Technically speaking, this is not a complete description of the hashing algorithm, so I suggest you either explain more, or remove this message
NOTE: This PR will keep in draft state until toolchain PoC and psABI spec ready.
Zicfilp has provided two labeling schemes: simple and complex (also known as function signature-based). The simple scheme uses an lpad with a constant 0, which does not require any hashing mechanism. In contrast, the complex labeling scheme computes the MD5 hash from the signature string.
Filling up an MD5 hash value is straightforward for compilers, but it is non-trivial work for humans to maintain. Therefore, we have added new assembler modifiers to compute this value.
See also: riscv/riscv-cfi#151