你如何构建Openssl_1.0.0版本4

时间:2017-02-22 08:31:41

标签: compilation openssl version elf

我有一个我试图运行的二进制文件,似乎特别需要OPENSSL_1.0.0版本4:

Version needs section '.gnu.version_r' contains 2 entries:
 Addr: 0x00000000080486ac  Offset: 0x0006ac  Link: 6 (.dynstr)
  000000: Version: 1  File: libcrypto.so.1.0.0  Cnt: 1
  0x0010:   Name: OPENSSL_1.0.0  Flags: none  Version: 4

我已经检查了openssl git中的源代码并构建了1.0.0-stable,但无法弄清楚如何专门构建二进制文件所需的内容。

我应该从openssl repo中查看哪个版本,如何编译它以便它可以被这个二进制文件使用?

以下是其精灵标题的其他可能的相关字段:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Intel 80386
  Version:                           0x1
  Entry point address:               0x804a6e0
  Start of program headers:          52 (bytes into file)
  Start of section headers:          214412 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         9
  Size of section headers:           40 (bytes)
  Number of section headers:         37
  Section header string table index: 34


Relocation section '.rel.plt' at offset 0x73c contains 37 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
0805b038  00000d07 R_386_JUMP_SLOT   00000000   MD5@OPENSSL_1.0.0

Dynamic section at offset 0x11f0c contains 25 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libcrypto.so.1.0.0]

Symbol table '.dynsym' contains 43 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name     
    13: 00000000     0 FUNC    GLOBAL DEFAULT  UND MD5@OPENSSL_1.0.0 (4)

Version symbols section '.gnu.version' contains 43 entries:
 Addr: 0000000008048656  Offset: 0x000656  Link: 5 (.dynsym)
  00c:   2 (GLIBC_2.0)     4 (OPENSSL_1.0.0)   2 (GLIBC_2.0)     0 (*local*)   

1 个答案:

答案 0 :(得分:1)

您看到的版本不是库的版本,而是表中符号的(任意)版本。正如jww已经指出的那样,它引用了OPENSSL_1.0.0这是符号版本字符串,并且与1.0.x版本分支有关。

请参阅https://blog.flameeyes.eu/2011/06/gold-readiness-obstacle-2-base-versioning/,了解我之前撰写的关于符号版本控制的随机引用。