我可以将 ELF 绑定到特定的 CPU

Can I bound an ELF to a particular CPU

检查ELF格式后,似乎没有区域指示哪个CPU将执行此文件。

我的问题是:

我们可以将特定的 CPU 分配给 ELF 吗?如果是,我该怎么做?

Can we assign a particular CPU to an ELF?

没有

if i want to assign a program to a particular cpu, how can i do it?

取决于 OS。

instead of use Linux command

在 Linux 上,您可以调用 sched_setaffinity to bind a process to a set of CPUs, or pthread_setaffinity_np 将线程绑定到一组 CPU(注意:这两个调用都不能移植到其他 OSes)。