Closed chenxuqiang closed 5 months ago
Thanks @chenxuqiang. Anyone from ARM that can review this?
This change makes sense to me. Without explicit specify a '.text' section in .S files, it will leave this decision to gcc (or GNU as)'s default behavior. Actually, default behavior cannot make sure the code always be put into section '.text'. Such as this file ( what @chenxuqiang modified)
sm3_mb/aarch64/sm3_mb_sve.S
, everything was put into '.rodata.cst16'
section, because '.rodata.cst16'
is declared in sm3_mb_common.S
, which is #include
ed by 'sm3_mb_sve.S', right before the start of its code section.
In conclusion, adding a '.text' section is a good catch.
For safety reasons, probably we should explicitly add '.text' in all .S assembly files.
Eg. here we can list all such files:
find . -depth -type f -path '*aarch64*' -name '*S' -exec sh -c 'grep -q "\.text" "$1" || echo "$1"' sh {} \;
so, @chenxuqiang would you mind to modify the commit's subject to make it more accurate? "Fix the problem that sve functions cannot be debugged by gdb" is misleading in my humble opinion. The issue can happen in all .S files if missing '.text' declaration.
Hi @chenxuqiang. Could you update this PR to address @docularxu comments? Adding .text in all .S files sounds like a good idea.
This is now merged, but @chenxuqiang, could you look into the other files and open another PR addressing @docularxu comments?
Closing this PR, as this code is merged. Feel free to open another one with more fixes.
fix issues #125