---
title: "修复bad ELF interpreter问题"
author: "^=^"
date: "2012-06-20T13:13:00Z"
tags: []
slug: "bad-elf-interpreter"
draft: false
lastmod: "2012-06-20T13:22:09Z"
id: 1564696
url: "https://fork-exec.iteye.com/blog/1564696"
---

新安装了FC 17 64位，在运行32位程序的时候有些问题，最直接的错误是：

/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

从网络上搜到文章，解决方法是用yum安装32位的glibc库，我的环境yum无法工作，此方法作罢。

手头恰好有32位的FC 12，于是考虑最直接的方法：缺哪个文件就从FC 12拷贝哪个文件。

最终拷贝了3个文件到/lib解决了这个问题，分别是：

ld-2.11.so

libc-2.11.so

libm-2.11.so

然后创建三个软链接，分别是：

lrwxrwxrwx. 1 root root 12 6月 19 14:12 libm.so.6 -&gt; libm-2.11.so  
lrwxrwxrwx. 1 root root 12 6月 19 13:57 libc.so.6 -&gt; libc-2.11.so  
lrwxrwxrwx. 1 root root 10 6月 19 13:55 ld-linux.so.2 -&gt; ld-2.11.so

经过上述步骤，32位的交叉编译环境可以正常编译我们的源码了。

由于时间原因，这样可行的原理本人还不知道，空闲时间会再追一下这个问题。