[lld] [LLD][ELF][RISCV] Handle .note.gnu.property sections for Zicfilp/Zicfiss features (PR #127193)

Ming-Yi Lai via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 00:10:08 PST 2025


mylai-mtk wrote:

> I would prefer use zicfilp= and zicfiss=, and it's my proposal for the option:
> -z zicfilp=force-unlabeled|force-func-sig|warning, -z zicfiss=force|warning or
> -z zicfilp=force-unlabeled|force-func-sig|report, -z zicfiss=force|report?
> 
> force|force-unlabeled|force-func-sig: Force set corresponding GNU property.
> warning or report: Report which object missing the GNU property.

I can see that your proposal squashes together the conventional CFI flags of "reporting on something wrong" and "forcing the feature to be on/off", which is good as they are usually mutually exclusive. Though I have a few opinions: 

+ I think `report` and `warning` do not state clearly the expected behavior. To be more specific, they do not state clearly what is to be reported/warned. To me they read like "report/warn on (enabled) Zicfilp/Zicfiss", which obviously doesn't make sense, so my next guess would be "report/warn on something wrong with enabled Zicfilp/Zicfiss", which is correct. However, IMHO it would be a bad thing that guesses and twists are needed to know what an option means
+ If `warning` or `report` is given to `-z zicfilp`, which labeling scheme is the user expecting? He can have 10 out of 10 files with the unlabeled scheme, but expects the func-sig scheme to be adopted

https://github.com/llvm/llvm-project/pull/127193


More information about the llvm-commits mailing list