Open silabs-hfegran opened 1 year ago
Hi @silabs-hfegran , I met similar issues with you, hope there will some way to not enable table jump for certain code
such as
.option arch, -zcmt
to disable cmt optionMaybe @pz9115 @linsinan1995 can help with this issue.
Thanks
Hi, @fanghuaqi
Hi @silabs-hfegran , I met similar issues with you, hope there will some way to not enable table jump for certain code
such as
- using the asm
.option arch, -zcmt
to disable cmt option
Not sure if this works or not. IIRC, the current relaxation phrase treat symbols from different object files equally, so this won't work unless we record the arch info of each object file and skip relaxing symbols from object files without zcmt arch option.
- allow a gcc option to not replace jump instruction to certain symbols not be replaced by table jump
I could imagine this option will be useful in some other scenarios, and better to have it. CC @pz9115
Hi, @fanghuaqi
Hi @silabs-hfegran , I met similar issues with you, hope there will some way to not enable table jump for certain code such as
- using the asm
.option arch, -zcmt
to disable cmt optionNot sure if this works or not. IIRC, the current relaxation phrase treat symbols from different object files equally, so this won't work unless we record the arch info of each object file and skip relaxing symbols from object files without zcmt arch option.
- allow a gcc option to not replace jump instruction to certain symbols not be replaced by table jump
I could imagine this option will be useful in some other scenarios, and better to have it. CC @pz9115
Thanks @linsinan1995 , option 1 is not working, I have tried it, currently didn't find a good way to achive it.
There are cases where compilation of a single, bare-metal .S-file with the zcmt-flag march-flag enabled causes the linker to replace jumps inside the assembly with table jump instructions - this creates several issues and does not really make sense to me:
Technically, this can be avoided with
-mno-relax
-flag to the linker, but I would not expect this to be necessary, as that also leads to an impact of potentially blocking other relaxations. That leads me to the question of what kind of scenario with tablejump-relaxation of a manually crafted assembly file would actually be useful?I do not currently have an example on hand to reproduce this, but I will try to add that here as soon as possible. Posting this now to raise awareness of this issue.