澄清二进制文件(PE / COFF和放大器; ELF)格式和放大器;术语 [英] Clarification on Binary file (PE/COFF & ELF) formats & terminology

查看:540
本文介绍了澄清二进制文件(PE / COFF和放大器; ELF)格式和放大器;术语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在术语混淆不大。

这是作为输入到链接器的文件被称作对象文件
  链接器生成一个图片文件,而这又是用作加载程序的输入。

A file that is given as input to the linker is called Object File. The linker produces an Image file, which in turn is used as input by the loader.

我得到这个从MS PE&放大器; COFF规范

I got this from "MS PE & COFF Specification"

Q1。图片文件也被称为二值图像二进制文件或只是二进制。对?

Q1. Image file is also referred to as Binary Image, Binary File or just Binary. Right?

Q2 因此,根据上述术语中,PE / ELF / COFF是的的格式图像文件的&放大器。不是的目标文件。的吧?但是,<一个href=\"http://www.sco.com/developers/gabi/latest/ch4.intro.html\">http://www.sco.com/developers/gabi/latest/ch4.intro.html说

Q2. So, according to the above stated terminology, the PE/ELF/COFF are the formats of Image File & not the Object File. right? But http://www.sco.com/developers/gabi/latest/ch4.intro.html says

本章描述了目标文件格式,称为ELF(可执行和链接格式)。有三种主要类型的目标文件。

This chapter describes the object file format, called ELF (Executable and Linking Format). There are three main types of object files.


      
  • 再定位文件的持有code和数据适用于其他链接
      目标文件创建一个可执行
      或共享的目标文件。

  • A relocatable file holds code and data suitable for linking with other object files to create an executable or a shared object file.

的可执行文件的持有适合执行的程序;该
  文件规定了如何执行exec(BA_OS)创建
  一个程序的进程映像。

An executable file holds a program suitable for execution; the file specifies how exec(BA_OS) creates a program's process image.

共享对象文件的持有code和数据适用于两个连接
  上下文。首先,链接器[参阅
  LD(BA_OS)]处理共享对象
  与其他可重定位和共享文件
  目标文件来创建另一个对象
  文件。二,动态连接器
  与可执行文件将其结合起来
  和其他共享对象来创建
  进程映像。

A shared object file holds code and data suitable for linking in two contexts. First, the link editor [see ld(BA_OS)] processes the shared object file with other relocatable and shared object files to create another object file. Second, the dynamic linker combines it with an executable file and other shared objects to create a process image.

自相矛盾他说,这两个对象档案与图像文件是ELF格式和放大器;他不是在所有的对象和放大器之间的区别;图像文件,但通常是指他们作为目标文件。是不是错了?

contradictorily he is saying that both Object File & Image File are ELF formats & He is not at all differentiating between object & image files but referring them commonly as Object files. Isn't it wrong?

Q3。我知道PE是从COFF的。但是,为什么PE格式的Microsoft规范命名的 Microsoft可移植可执行和通用对象文件格式规范的。难道他们还支持COFF?如果他们在哪个OS?我认为PE完全取代COFF很久以前。

Q3. I know that PE is derived from COFF. But why does the Microsoft specifications of PE format is named Microsoft Portable Executable "and Common Object File Format Specification". Do they still support COFF? If they, in which OS? I thought PE completely replaced COFF long ago.

推荐答案

我是OP。每个人的答案是部分答案。所以,我的所有其他的答案跟我学到了什么,完成了答案的完美组合。

这是一般使用的术语。


  • 这是作为输入连接器(汇编器的输出)调用的文件对象文件定位文件

链接器生成一个图像文件,而这又是用作加载程序的输入。现在,一个图片文件可以是一个可执行文件库文件。这些库文件有两种:

The linker produces an Image file, which in turn is used as input by the loader. Now, an Image file can either be an Executable file or Library file. These 'Library files' are of two kinds:


  1. 静态库(*为Windows .lib文件。* .A对于Linux)

  2. 共享/动态库: DLL (* .dll,在窗口)及共享对象文件(*。所以在Linux中)

  1. Static Library (*.lib files for windows. *.a for linux)
  2. Shared/Dynamic libraries : DLL ( *.dll on windows) & Shared Object file( *.so in Linux)

术语二进制文件 / 二进制可以被用来指代一个ObjectFile或镜像文件。上下文取决于向上已了解。这是一个非常通用术语。

  • The term Binary File / Binary can be used to refer to either an ObjectFile or an ImageFile. Undestand depending up on the context. It is a very general term.

    装载机负荷时,图像文件到内存中。然后,它被称为模块(我不知道关于Linux的家伙,但Windows家伙把它叫做模块

    Loader when loads the image file into memory. Then it is called Module (I'm not sure about Linux guys, but windows guys call it Module

    http://www.gliffy.com/pubdoc/1978433/L.jpg

    http://www.gliffy.com/pubdoc/1978433/L.jpg

    正如我所说的,这些都是一般使用的术语。还有的术语二进制文件,映像文件或目标文件。

    As I said, these are "Generally" used terminology. There are no strict definitions for the terms 'binary file', 'image file', or 'object file'.

    特别地,术语对象文件可能有时被用来指由编译器对于由连接器使用的中间文件输出,但在另一些情况下可能意味着一个可执行文件。

    Particularly the term 'object file' might sometimes be used to mean an intermediate file output by the compiler for use by the linker, but in another context might mean an executable file.

    特别是在不同平台上,他们可能被用于指不同的或类似的东西。在一个平台上讨论问题即使,一位作家可能使用的术语稍有不同的另一个。

    Especially on different platforms they might be used for refer to different or similar things. Even when discussing issues on a single platform, one writer might use the terms somewhat differently than another.


    • 这两个ObjectFile&安培;镜像文件是在Windows和放大器PE格式; ELF格式在linux。

    • ELF不仅是图像文件的格式,但也是对象文件的格式。

    • 每个ELF文件开始与ELF头。一个ELF头的第二个字段是 e_type ;这个领域让我们知道该文件是否是一个对象文件(ELF说法又名一个浮动),或图像(它可以是可执行文件或共享对象),或别的东西(核心文件的也ELF文件)。

    • 我不知道是否有在报头区别于图像文件的目标文件的任何一点。它需要进行检查。

    • Both ObjectFile & ImageFile are in PE Format in windows & ELF format in linux.
    • ELF is not only the format of the image file but is also the format of the object file.
    • Every ELF file starts with an ELF Header. The second field of an ELF Header is e_type; this fields lets us know whether the file is an object file (aka a relocatable in ELF parlance), or an image (which can be either an executable or a shared object) or something else (core file's are also ELF files).
    • I don't know if there is any bit in header that differentiates an Object file from Image file. It needs to be checked.

    我知道PE是从COFF的。
      但是为什么微软
      PE格式的规格被命名为
      Microsoft可移植可执行和
      通用对象文件格式
      规范。难道他们仍然支持
      COFF?如果他们在哪个OS?我想
      PE完全取代COFF很久以前。

    I know that PE is derived from COFF. But why does the Microsoft specifications of PE format is named Microsoft Portable Executable "and Common Object File Format Specification". Do they still support COFF? If they, in which OS? I thought PE completely replaced COFF long ago.

    至于PE与COFF,我的记忆是,微软用COFF规范为出发点,为PE规范,但延长它自己的需求。所以,严格来说是PE的文件是不是一个COFF的文件,但它在很多方面非常相似。

    As far as "PE" vs "COFF", my recollection is that Microsoft use the "COFF" specification as the starting point for the "PE" specification but extended it for their needs. So strictly speaking a "PE" file isn't a "COFF" file, but it's very similar in many ways.

    这篇关于澄清二进制文件(PE / COFF和放大器; ELF)格式和放大器;术语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆