Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[英雄贴][Linux Kernel] ORC unwinder w/o pessimizing flags #51

Open
xry111 opened this issue Mar 25, 2024 · 1 comment
Open

[英雄贴][Linux Kernel] ORC unwinder w/o pessimizing flags #51

xry111 opened this issue Mar 25, 2024 · 1 comment
Labels
AREA: Kernel 英雄帖 Volunteers welcome!

Comments

@xry111
Copy link
Member

xry111 commented Mar 25, 2024

Add jump tables and relaxation support to objtool so we don't need to pessimize the code with -fno-jump-tables and -mno-relax.

@xen0n xen0n added 英雄帖 Volunteers welcome! AREA: Kernel labels Apr 1, 2024
@MQ-mengqing
Copy link

There is an example [1] to enable relax under ORC by generating orc info with symbol reloc rather than sec+offset reloc.

For jump table, (usually c jump table), the a direct way to get it is record the order of instructions execution. When encounter jr reg, backwards search the jump table. But it is complex to implement.
The second way is add reloc at jr reg by gcc, (or some other info, not need the reloc form). I tried set reloc info indicate the begin and len of jump table long time ago, it is effective, unfortunately except goto table. See goto table in ___bpf_prog_run. It is difficult for me to add the jump table info to gototable in gcc.
Besides, the asm jump table is as important as c jump table. I noticed LoongArch marked losts of STACK_FRAME_NON_STANDARD in *.S, actually it is not correct because we should have probabilities to do backtrace from __clear_user_fast, __memcpy_small and others. They should also be handled in some way.
Look to the future of objtool, I think generating ORC info by SFrame is possible. SFrame is an interesting object.

[1] MQ-mengqing/linux@a26d48b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: Kernel 英雄帖 Volunteers welcome!
Projects
None yet
Development

No branches or pull requests

3 participants