Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

What's the meaning of elfnn-<arch>.c and elfxx-<arch>.c in binutils/bfd?

I am tracing binutils source code.
I found that there are files named elfnn-<arch>.c and elfxx-<arch>.c in binutils/bfd.
What't the meaning of elfnn and elfxx?

Thanks.

question from:https://stackoverflow.com/questions/65948448/whats-the-meaning-of-elfnn-arch-c-and-elfxx-arch-c-in-binutils-bfd

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In cases where an architecture supports only a 32-bit or a 64-bit ELF-based ABI, the code for that architecture is in a file named elf32-arch.c or elf64-arch.c, respectively. In some cases, an architecture supports both, but the implementations are very different, so you'll see both an elf32-arch.c and an elf64-arch.c source file (e.g., ppc, mips).

But some of the more modern architectures, where 32-bit and 64-bit support were developed side by side, share a lot of the implementation (e.g., aarch64, ia64, riscv). In those cases, you'll see an elfnn-arch.c source file. This file is a template; the build process autogenerates elf32- and elf64- specializations of the file from the template. Still, a lot of code is common to both 32-bit and 64-bit without the need for specialization, so you'll find that code in an elfxx-arch.c source file, which is not a template.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...