现在的位置: 首页 > 综合 > 正文

ELF文件格式

2013年08月02日 ⁄ 综合 ⁄ 共 1598字 ⁄ 字号 评论关闭

ELF文件格式

在Blackfin的Linux世界中,有两种基本的文件格式:

  • FLAT:二进制的Flat文件通常被称为BFLT,它是基于原始的a.out格式的一种相对简单的轻量级可执行格式。BFLT文件是嵌入式Linux的默认文件格式。
  • FDPIC ELF:可执行和可链接格式最初是由Unix System实验室开发出来的,现在已经成为文件格式的标准。相对于BFLT格式而言,ELF标准更强大并且更灵活。但是,它更重量级一些,需要更多的磁盘空间以及有一定的运行时开销。

这两种格式都支持静态和动态链接(共享库),但是,ELF更容易使用及创建动态链接库。只有ELF支持动态加载(dlopen(), dlsym(), dlclose()),以及创建和维护共享库的标准方法。

记住在Linux系统下面,我们使用FDPIC ELF格式。FDPIC格式和ELF格式的不同之处,仅仅在于其内部要求在没有MMU的情况下工作。从程序员的角度来说,无论从哪点来看,ELF就是ELF。

-----------------------------------------------------------------------------------------------------------------

Executable file formats:

Files can be in two basic formats in the Blackfin Linux world:

FLAT
Binary Flat files commonly known as BFLT, are a relatively simple and lightweight executable format based on the original a.out format. BFLT files are the default file format in embedded Linux.
FDPIC ELF
The executable and linking format (ELF) was originally developed by Unix System Laboratories and has become the standard in file formats. TheELF
standard has greater power and more flexibility than the BFLT format. However, they are more heavyweight, requiring more disk space and having a small run-time penalty.

Both formats support static and dynamic linking (shared libraries), although it is much easier to use and create shared libraries withELF. OnlyELF
supports dynamic loading (dlopen(),dlsym(), dlclose()), and the standard method for creating and maintaining shared libraries. (For more information on libraries, see thecreating
libraries
page.)

Keep in mind that under Linux, we use the FDPIC
ELF
format. The difference between the FDPICELF format and theELF
format is merely in the internals (how the PLT is implemented) as a requirement for working without an MMU. For all intents and purposes from the programmer's perspective, the
ELF is anELF.

抱歉!评论已关闭.