2010-04-26 15 views
103

Stavo installando un'applicazione binaria Linux su Ubuntu 9.10 x86_64. L'applicazione fornita con una vecchia versione di gzip (1.2.4), che è stato compilato per un kernel molto più antica:Errore "Nessun file o directory" durante l'esecuzione di un binario

$ file gzip 
gzip: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.0.0, stripped 

non ero in grado di eseguire questo programma. Se ho provato, questo è accaduto:

$ ./gzip 
-bash: ./gzip: No such file or directory 

LDD era ugualmente infelice con questo binario:

$ ldd gzip 
     not a dynamic executable 

Sono curioso: Qual è la fonte più probabile di questo problema? Un file danneggiato? O un'incompatibilità binaria dovuta alla costruzione di un vecchio kernel {kernel, libc, ...}?

suggestsions di Per nos, ecco l'output del strace ./gzip:

execve("./gzip", ["./gzip"], [/* 24 vars */]) = -1 ENOENT (No such file or directory) 
dup(2)         = 3 
fcntl(3, F_GETFL)      = 0x8002 (flags O_RDWR|O_LARGEFILE) 
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 10), ...}) = 0 
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa8c9eee000 
lseek(3, 0, SEEK_CUR)     = -1 ESPIPE (Illegal seek) 
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory 
) = 40 
close(3)        = 0 
munmap(0x7fa8c9eee000, 4096)   = 0 
exit_group(1)       = ? 

ecco l'output del readelf -a ./gzip:

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:    0x8048d20 
    Start of program headers:   52 (bytes into file) 
    Start of section headers:   46852 (bytes into file) 
    Flags:        0x0 
    Size of this header:    52 (bytes) 
    Size of program headers:   32 (bytes) 
    Number of program headers:   6 
    Size of section headers:   40 (bytes) 
    Number of section headers:   26 
    Section header string table index: 25 

Section Headers: 
    [Nr] Name    Type   Addr  Off Size ES Flg Lk Inf Al 
    [ 0]     NULL   00000000 000000 000000 00  0 0 0 
    [ 1] .interp   PROGBITS  080480f4 0000f4 000013 00 A 0 0 1 
    [ 2] .note.ABI-tag  NOTE   08048108 000108 000020 00 A 0 0 4 
    [ 3] .hash    HASH   08048128 000128 000178 04 A 4 0 4 
    [ 4] .dynsym   DYNSYM   080482a0 0002a0 000370 10 A 5 1 4 
    [ 5] .dynstr   STRTAB   08048610 000610 0001ee 00 A 0 0 1 
    [ 6] .gnu.version  VERSYM   080487fe 0007fe 00006e 02 A 4 0 2 
    [ 7] .gnu.version_r VERNEED   0804886c 00086c 000030 00 A 5 1 4 
    [ 8] .rel.got   REL    0804889c 00089c 000008 08 A 4 20 4 
    [ 9] .rel.bss   REL    080488a4 0008a4 000030 08 A 4 22 4 
    [10] .rel.plt   REL    080488d4 0008d4 000158 08 A 4 12 4 
    [11] .init    PROGBITS  08048a2c 000a2c 00002f 00 AX 0 0 4 
    [12] .plt    PROGBITS  08048a5c 000a5c 0002c0 04 AX 0 0 4 
    [13] .text    PROGBITS  08048d20 000d20 007f4c 00 AX 0 0 16 
    [14] .fini    PROGBITS  08050c6c 008c6c 00001a 00 AX 0 0 4 
    [15] .rodata   PROGBITS  08050ca0 008ca0 001751 00 A 0 0 32 
    [16] .data    PROGBITS  08053400 00a400 000ab4 00 WA 0 0 32 
    [17] .eh_frame   PROGBITS  08053eb4 00aeb4 000004 00 WA 0 0 4 
    [18] .ctors   PROGBITS  08053eb8 00aeb8 000008 00 WA 0 0 4 
    [19] .dtors   PROGBITS  08053ec0 00aec0 000008 00 WA 0 0 4 
    [20] .got    PROGBITS  08053ec8 00aec8 0000bc 04 WA 0 0 4 
    [21] .dynamic   DYNAMIC   08053f84 00af84 0000a0 08 WA 5 0 4 
    [22] .bss    NOBITS   08054040 00b040 050630 00 WA 0 0 32 
    [23] .comment   PROGBITS  00000000 00b040 000487 00  0 0 1 
    [24] .note    NOTE   00000487 00b4c7 00017c 00  0 0 1 
    [25] .shstrtab   STRTAB   00000000 00b643 0000be 00  0 0 1 
Key to Flags: 
    W (write), A (alloc), X (execute), M (merge), S (strings) 
    I (info), L (link order), G (group), x (unknown) 
    O (extra OS processing required) o (OS specific), p (processor specific) 

There are no section groups in this file. 

Program Headers: 
    Type   Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align 
    PHDR   0x000034 0x08048034 0x08048034 0x000c0 0x000c0 R E 0x4 
    INTERP   0x0000f4 0x080480f4 0x080480f4 0x00013 0x00013 R 0x1 
     [Requesting program interpreter: /lib/ld-linux.so.2] 
    LOAD   0x000000 0x08048000 0x08048000 0x0a3f1 0x0a3f1 R E 0x1000 
    LOAD   0x00a400 0x08053400 0x08053400 0x00c24 0x51270 RW 0x1000 
    DYNAMIC  0x00af84 0x08053f84 0x08053f84 0x000a0 0x000a0 RW 0x4 
    NOTE   0x000108 0x08048108 0x08048108 0x00020 0x00020 R 0x4 

Section to Segment mapping: 
    Segment Sections... 
    00  
    01  .interp 
    02  .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.got .rel.bss .rel.plt .init .plt .text .fini .rodata 
    03  .data .eh_frame .ctors .dtors .got .dynamic .bss 
    04  .dynamic 
    05  .note.ABI-tag 

Dynamic section at offset 0xaf84 contains 20 entries: 
    Tag  Type       Name/Value 
0x00000001 (NEEDED)      Shared library: [libc.so.6] 
0x0000000c (INIT)      0x8048a2c 
0x0000000d (FINI)      0x8050c6c 
0x00000004 (HASH)      0x8048128 
0x00000005 (STRTAB)      0x8048610 
0x00000006 (SYMTAB)      0x80482a0 
0x0000000a (STRSZ)      474 (bytes) 
0x0000000b (SYMENT)      16 (bytes) 
0x00000015 (DEBUG)      0x0 
0x00000003 (PLTGOT)      0x8053ec8 
0x00000002 (PLTRELSZ)     344 (bytes) 
0x00000014 (PLTREL)      REL 
0x00000017 (JMPREL)      0x80488d4 
0x00000011 (REL)      0x804889c 
0x00000012 (RELSZ)      56 (bytes) 
0x00000013 (RELENT)      8 (bytes) 
0x6ffffffe (VERNEED)     0x804886c 
0x6fffffff (VERNEEDNUM)     1 
0x6ffffff0 (VERSYM)      0x80487fe 
0x00000000 (NULL)      0x0 

Relocation section '.rel.got' at offset 0x89c contains 1 entries: 
Offset  Info Type   Sym.Value Sym. Name 
08053f80 00000106 R_386_GLOB_DAT 00000000 __gmon_start__ 

Relocation section '.rel.bss' at offset 0x8a4 contains 6 entries: 
Offset  Info Type   Sym.Value Sym. Name 
08054040 00000505 R_386_COPY  08054040 stdout 
08054044 00002705 R_386_COPY  08054044 stderr 
08054048 00000805 R_386_COPY  08054048 __ctype_b 
0805404c 00001f05 R_386_COPY  0805404c stdin 
08054050 00001005 R_386_COPY  08054050 optarg 
08054054 00001e05 R_386_COPY  08054054 optind 

Relocation section '.rel.plt' at offset 0x8d4 contains 43 entries: 
Offset  Info Type   Sym.Value Sym. Name 
08053ed4 00000307 R_386_JUMP_SLOT 08048a6c chown 
08053ed8 00003407 R_386_JUMP_SLOT 08048a7c __register_frame_info 
08053edc 00001907 R_386_JUMP_SLOT 08048a8c write 
08053ee0 00002e07 R_386_JUMP_SLOT 08048a9c fileno 
08053ee4 00002607 R_386_JUMP_SLOT 08048aac strcmp 
08053ee8 00003507 R_386_JUMP_SLOT 08048abc close 
08053eec 00000d07 R_386_JUMP_SLOT 08048acc perror 
08053ef0 00001a07 R_386_JUMP_SLOT 08048adc fprintf 
08053ef4 00000907 R_386_JUMP_SLOT 08048aec getenv 
08053ef8 00002007 R_386_JUMP_SLOT 08048afc signal 
08053efc 00001207 R_386_JUMP_SLOT 08048b0c fflush 
08053f00 00002407 R_386_JUMP_SLOT 08048b1c unlink 
08053f04 00002a07 R_386_JUMP_SLOT 08048b2c __errno_location 
08053f08 00001407 R_386_JUMP_SLOT 08048b3c chmod 
08053f0c 00000e07 R_386_JUMP_SLOT 08048b4c malloc 
08053f10 00001d07 R_386_JUMP_SLOT 08048b5c __deregister_frame_inf 
08053f14 00002907 R_386_JUMP_SLOT 08048b6c __xstat 
08053f18 00000b07 R_386_JUMP_SLOT 08048b7c fgets 
08053f1c 00002c07 R_386_JUMP_SLOT 08048b8c __fxstat 
08053f20 00001507 R_386_JUMP_SLOT 08048b9c __lxstat 
08053f24 00000a07 R_386_JUMP_SLOT 08048bac __strtol_internal 
08053f28 00002207 R_386_JUMP_SLOT 08048bbc strncmp 
08053f2c 00003007 R_386_JUMP_SLOT 08048bcc __libc_start_main 
08053f30 00001c07 R_386_JUMP_SLOT 08048bdc strcat 
08053f34 00000407 R_386_JUMP_SLOT 08048bec printf 
08053f38 00001307 R_386_JUMP_SLOT 08048bfc lseek 
08053f3c 00000c07 R_386_JUMP_SLOT 08048c0c memcpy 
08053f40 00001607 R_386_JUMP_SLOT 08048c1c strrchr 
08053f44 00001b07 R_386_JUMP_SLOT 08048c2c ctime 
08053f48 00000707 R_386_JUMP_SLOT 08048c3c getopt_long 
08053f4c 00003207 R_386_JUMP_SLOT 08048c4c closedir 
08053f50 00002507 R_386_JUMP_SLOT 08048c5c opendir 
08053f54 00003107 R_386_JUMP_SLOT 08048c6c open 
08053f58 00002b07 R_386_JUMP_SLOT 08048c7c exit 
08053f5c 00001807 R_386_JUMP_SLOT 08048c8c calloc 
08053f60 00002d07 R_386_JUMP_SLOT 08048c9c _IO_putc 
08053f64 00003607 R_386_JUMP_SLOT 08048cac free 
08053f68 00000607 R_386_JUMP_SLOT 08048cbc utime 
08053f6c 00000f07 R_386_JUMP_SLOT 08048ccc isatty 
08053f70 00002307 R_386_JUMP_SLOT 08048cdc strncpy 
08053f74 00001107 R_386_JUMP_SLOT 08048cec readdir 
08053f78 00002107 R_386_JUMP_SLOT 08048cfc read 
08053f7c 00000207 R_386_JUMP_SLOT 08048d0c strcpy 

There are no unwind sections in this file. 

Symbol table '.dynsym' contains 55 entries: 
    Num: Value Size Type Bind Vis  Ndx Name 
    0: 00000000  0 NOTYPE LOCAL DEFAULT UND 
    1: 00000000  0 NOTYPE WEAK DEFAULT UND __gmon_start__ 
    2: 08048d0c 34 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    3: 08048a6c 136 FUNC GLOBAL DEFAULT UND [email protected]_2.1 (2) 
    4: 08048bec 41 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    5: 08054040  4 OBJECT GLOBAL DEFAULT 22 [email protected]_2.0 (3) 
    6: 08048cbc 59 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    7: 08048c3c 43 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    8: 08054048  4 OBJECT GLOBAL DEFAULT 22 [email protected]_2.0 (3) 
    9: 08048aec 224 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    10: 08048bac 1106 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    11: 08048b7c 202 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    12: 08048c0c 62 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    13: 08048acc 111 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    14: 08048b4c 338 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    15: 08048ccc 46 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    16: 08054050  4 OBJECT GLOBAL DEFAULT 22 [email protected]_2.0 (3) 
    17: 08048cec 142 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    18: 08048b0c 152 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    19: 08048bfc 61 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    20: 08048b3c 59 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    21: 08048b9c 314 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    22: 08048c1c 441 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    23: 0804f608 29 FUNC GLOBAL DEFAULT 13 basename 
    24: 08048c8c 563 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    25: 08048a8c 61 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    26: 08048adc 36 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    27: 08048c2c 35 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    28: 08048bdc 49 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    29: 08048b5c 162 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    30: 08054054  4 OBJECT GLOBAL DEFAULT 22 [email protected]_2.0 (3) 
    31: 0805404c  4 OBJECT GLOBAL DEFAULT 22 [email protected]_2.0 (3) 
    32: 08048afc 181 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    33: 08048cfc 61 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    34: 08048bbc 148 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    35: 08048cdc 147 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    36: 08048b1c 55 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    37: 08048c5c 412 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    38: 08048aac 58 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    39: 08054044  4 OBJECT GLOBAL DEFAULT 22 [email protected]_2.0 (3) 
    40: 0804f7fc 40 FUNC GLOBAL DEFAULT 13 error 
    41: 08048b6c 314 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    42: 08048b2c 27 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    43: 08048c7c 200 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    44: 08048b8c 314 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    45: 08048c9c 150 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    46: 08048a9c 53 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    47: 08050ca4  4 OBJECT GLOBAL DEFAULT 15 _IO_stdin_used 
    48: 08048bcc 261 FUNC GLOBAL DEFAULT UND [email protected]_2.0 (3) 
    49: 08048c6c 61 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    50: 08048c4c 112 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    51: 0804f824 66 FUNC GLOBAL DEFAULT 13 warn 
    52: 08048a7c 116 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    53: 08048abc 55 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 
    54: 08048cac 202 FUNC WEAK DEFAULT UND [email protected]_2.0 (3) 

Histogram for bucket list length (total of 37 buckets): 
Length Number  % of total Coverage 
     0 10   (27.0%) 
     1 14   (37.8%)  25.9% 
     2 4   (10.8%)  40.7% 
     3 4   (10.8%)  63.0% 
     4 5   (13.5%) 100.0% 

Version symbols section '.gnu.version' contains 55 entries: 
Addr: 00000000080487fe Offset: 0x0007fe Link: 4 (.dynsym) 
    000: 0 (*local*)  0 (*local*)  3 (GLIBC_2.0)  2 (GLIBC_2.1) 
    004: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    008: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    00c: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    010: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    014: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  1 (*global*) 
    018: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    01c: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    020: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    024: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    028: 1 (*global*)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 
    02c: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  1 (*global*) 
    030: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0)  1 (*global*) 
    034: 3 (GLIBC_2.0)  3 (GLIBC_2.0)  3 (GLIBC_2.0) 

Version needs section '.gnu.version_r' contains 1 entries: 
Addr: 0x000000000804886c Offset: 0x00086c Link: 5 (.dynstr) 
    000000: Version: 1 File: libc.so.6 Cnt: 2 
    0x0010: Name: GLIBC_2.0 Flags: none Version: 3 
    0x0020: Name: GLIBC_2.1 Flags: none Version: 2 

Notes at offset 0x00000108 with length 0x00000020: 
    Owner   Data size  Description 
    GNU   0x00000010  NT_GNU_ABI_TAG (ABI version tag) 

Notes at offset 0x0000b4c7 with length 0x0000017c: 
    Owner   Data size  Description 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 
    01.01   0x00000000  NT_VERSION (version) 

risposta

138

La risposta è in questa linea di uscita del readelf -a nella domanda iniziale

[Requesting program interpreter: /lib/ld-linux.so.2] 

mi mancava il file /lib/ld-linux.so.2, che è necessaria per l'esecuzione a 32 bit app. Il pacchetto di Ubuntu che ha questo file è libc6-i386.

+4

Ha avviato il mio programma ma presto si è verificato un altro errore correlato. Questa (grande installazione) la risolve: sudo apt-get install ia32-libs – RyanfaeScotland

+2

Per chiarire: sudo apt-get install libc6-i386 – thiagolr

+16

Se qualcuno ha ancora problemi dopo aver installato la libreria di cui sopra, prova quanto segue (ha funzionato per me): 'sudo apt-get install libc6-i386 lib32stdC++ 6 lib32gcc1 lib32ncurses5 lib32z1' – ctitze

1

E 'possibile che l'eseguibile è collegata in modo statico ed è per questo ldd gzip non lo fa vedere qualsiasi link - perché non lo è. Non so molto di cose così lontane, quindi non so se ci sarebbero incompatibilità se le biblioteche sono collegate staticamente. Potrei aspettarci che ci sia.

So che è la cosa più ovvia in corso e sono sicuro che l'hai fatto, ma chmod +x ./gzip, sì? Nessun file o directory di questo tipo è un sintomo classico di ciò che non è stato fatto, ecco perché ne parlo.

+0

Sì, le autorizzazioni sul file sono impostate correttamente. –

+0

Pensato tanto. Roba buona. –

17

Si ottiene questo errore quando si tenta di eseguire una generazione a 32 bit sul proprio sistema operativo Linux a 64 bit.

anche contrastare quello file aveva da dire sul binario si è tentato (es: 32-bit) con quello che si ottiene per il vostro /bin/gzip:

$ file /bin/gzip 
/bin/gzip: ELF 64-bit LSB executable, x64-64, version 1 (SYSV), \ 
dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped 

che è quello che ottengo su Ubuntu 9.10 per amd64 aka x86_64 .

Modifica: il post espanso mostra che l'uscita readelf riflette anche una build a 32 bit.

+0

Penso che sia corretto, ma con il pacchetto giusto installato, le app a 32 bit possono essere eseguite. Penso che sia libc-i386, ho postato una risposta a parte su questo. –

3

Penso che l'installazione x86-64 non abbia il linker di runtime i386. L'ENOENT è probabilmente dovuto al sistema operativo che cerca qualcosa come /lib/ld.so.1 o simili. Questo è in genere parte del runtime glibc a 32 bit e, anche se non ho familiarità con Ubuntu, suppongo che abbiano una sorta di pacchetto di compatibilità a 32 bit da installare. Fortunatamente gzip dipende solo dalla libreria C, quindi probabilmente è tutto ciò che devi installare.

+0

Sì, è possibile installare il pacchetto di architettura ppc se lo si desidera. 'dpkg -i --force-architecture ' lo farà se si ha un file .deb. –

+0

Ho la sensazione che ci sia un modo per farlo anche tramite apt/aptitude ... Non ho usato Ubuntu in 2+ anni. yum install ld.i686 lo fa per fedora. –

15

Vecchia domanda, ma speriamo che questo aiuti qualcun altro.

Nel mio caso stavo usando una toolchain su Ubuntu 12.04 che è stata costruita su Ubuntu 10.04 (richiede GCC 4.1 per compilare). Poiché la maggior parte delle librerie è stata spostata su dir multiarch, non è stato possibile trovare ld.so. Quindi, crea un link simbolico per questo.

Controllare percorso richiesto:

$ readelf -a arm-linux-gnueabi-gcc | grep interpreter: 
     [Requesting program interpreter: /lib/ld-linux-x86-64.so.2]

Creare link simbolico:

$ sudo ln -s /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2

Se siete su 32 bit, sarà i386-linux-gnu e non x86_64-linux-gnu.

+0

Questo ha funzionato per me eseguendo Bossa (bossac, bossash). Aggiunta di parole chiave qui, quindi è facile trovare su Google! –

0

Bene un'altra possibile causa di questo può essere un'interruzione di riga alla fine di ogni riga e linea di shebang Se è stato codificato in Windows IDE è possibile che Windows abbia aggiunto la propria interruzione di riga alla fine di ogni riga e quando hai provato ad eseguirlo su linux, l'interruzione di riga causa problemi

1

Ho anche avuto problemi perché il mio interprete di programma era /lib/ld-linux.so.2 tuttavia era su un dispositivo incorporato, quindi ho risolto il problema chiedendo gcc per utilizzare ls-uClibc invece come segue:

-Wl,--dynamic-linker=/lib/ld-uClibc.so.0 
Problemi correlati