before this, confirm that you don't have 32bit libs notably 32bit libc, e.g. you have

/lib64/ld-linux-x86-64.so.2 but not /lib32/ld-linux.so.2

https://wiki.debian.org/Multiarch

run following on Debian 64bit to add basic support for 32bit programs (anyway you need ld-linux at least...)

dpkg --add-architecture i386;
aptitude install libc6-i386 libc6-dev-i386  (note that don't use libc6:i386 otherwise apt thinks you'd use libc-i386 as the main libc)

write a simple "hello world", and compile with different flags

gcc -m32 hello.c -o hello32
ldd hello32
linux-gate.so. (0xf7765000)
libc.so. => /lib32/libc.so. (0xf75a2000)
/lib/ld-linux.so. (0xf7766000) gcc -m64 hello.c -o hello64
ldd hello64
linux-vdso.so. (0x00007fff1cfa4000)
libc.so. => /lib/x86_64-linux-gnu/libc.so. (0x00007fe71d001000)
/lib64/ld-linux-x86-.so. (0x00007fe71d3c1000)

What is ld-linux.so.2?

This program is defined as part of the structure of the ELF file, in the INTERP section of the program header. For 32bit linux binaries, this is the typical name of the 32bit interpreter. For 64bit binaries, you'll find it is typically called ld-linux-x86_64.so.2 (for 64bit x86 platforms).

You can determine this information yourself using readelf -l, and the INTERP section:

INTERP         0x0000000000000238 0x0000000000400238 0x0000000000400238
0x000000000000001c 0x000000000000001c R 1
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

What is linux-gate.so.1? very good article on this: http://www.trilithium.com/johan/2005/08/linux-gate/

there's not supposed to be a linux-gate.so.1 file present anywhere on the file system; it's a virtual DSO (dynamic shared object), a shared object exposed by the kernel at a fixed address in every process' memory:
http://en.wikipedia.org/wiki/VDSO

for example, run "cat /proc/self/maps" and it'll give the memory layout of cat process

cat /proc/self/maps
-0040b000 r-xp : /bin/cat
0060a000-0060b000 r--p 0000a000 : /bin/cat
0060b000-0060c000 rw-p 0000b000 : /bin/cat
- rw-p : [heap]
7fb1eabf3000-7fb1ead93000 r-xp : /lib/x86_64-linux-gnu/libc-2.18.so
7fb1ead93000-7fb1eaf92000 ---p 001a0000 : /lib/x86_64-linux-gnu/libc-2.18.so
7fb1eaf92000-7fb1eaf96000 r--p 0019f000 : /lib/x86_64-linux-gnu/libc-2.18.so
7fb1eaf96000-7fb1eaf98000 rw-p 001a3000 : /lib/x86_64-linux-gnu/libc-2.18.so
7fb1eaf98000-7fb1eaf9c000 rw-p :
7fb1eaf9c000-7fb1eafbc000 r-xp : /lib/x86_64-linux-gnu/ld-2.18.so
7fb1eb018000-7fb1eb1a1000 r--p : /usr/lib/locale/locale-archive
7fb1eb1a1000-7fb1eb1a4000 rw-p :
7fb1eb1b9000-7fb1eb1bb000 rw-p :
7fb1eb1bb000-7fb1eb1bc000 r--p 0001f000 : /lib/x86_64-linux-gnu/ld-2.18.so
7fb1eb1bc000-7fb1eb1bd000 rw-p : /lib/x86_64-linux-gnu/ld-2.18.so
7fb1eb1bd000-7fb1eb1be000 rw-p :
7fff48a06000-7fff48a27000 rw-p : [stack]
7fff48a49000-7fff48a4b000 r-xp : [vdso]
ffffffffff600000-ffffffffff601000 r-xp : [vsyscall]

32bit / 64bit co-exist Linux, ld-linux.so, linux-gate.so.1 etc的更多相关文章

  1. Linux入门基础(一):Linux基本操作

    命令行BASH基本操作 Shell 用户不能直接操作内核,所以用户操作通过shell传递给内核 shell分为两种 : GUI 图形界面 (linux一般是GNOME) CLI 命令行界面 (linu ...

  2. 【转】如何查看linux版本 如何查看LINUX是多少位

    原文网址:http://sopace.blog.51cto.com/1227753/670526 如何得知自己正在使用的linux是什么版本呢,下面的几种方法将给你带来答案! 1. 查看内核版本命令: ...

  3. 如何确定一台linux主机是Linux (i386/i686)还是Linux (x86_64)

    在下软件包的时候,往往会遇到一个选择: 假设自己的主机是Linux,那么Linux (i386/i686)和Linux (x86_64)究竟应该选哪一个呢? 针对当今的硬件而言,如果你主机的CPU是6 ...

  4. 【Linux】-NO.86.Linux.6.C.1.001-【CentOS 7 Install GCC】-

    1.0.0 Summary Tittle:[Linux]-NO.86.Linux.6.C.1.001-[CentOS 7 Install GCC]- Style:Java Series:Log4j S ...

  5. Linux Kernel - Debug Guide (Linux内核调试指南 )

    http://blog.csdn.net/blizmax6/article/details/6747601 linux内核调试指南 一些前言 作者前言 知识从哪里来 为什么撰写本文档 为什么需要汇编级 ...

  6. 装机预备技能,Linux系统简介,安装Linux系统,Linux基本操作-云计算学习(2)

    装机预备技能 问题 要求安装一台可用的KVM服务器: RHEL与CentOS系统有什么关联? Linux系统中第三块SCSI硬盘如何表示? 步骤 实现此案例需要按照如下步骤进行. 步骤一:RHEL系统 ...

  7. 嵌入式Linux开发教程:Linux常见命令(上篇)

    摘要:这是对周立功编著的<嵌入式Linux开发教程>的第7期连载.本期刊载内容有关LinuxLinux常见命令中的导航命令.目录命令和文件命令.下一期将连载网络操作命令.安装卸载文件系统等 ...

  8. Linux中断管理 (1)Linux中断管理机制

    目录: <Linux中断管理> <Linux中断管理 (1)Linux中断管理机制> <Linux中断管理 (2)软中断和tasklet> <Linux中断管 ...

  9. [中英对照]Linux kernel coding style | Linux内核编码风格

    Linux kernel coding style | Linux内核编码风格 This is a short document describing the preferred coding sty ...

  10. Linux随笔-鸟哥Linux服务器篇学习总结(全)

    作者:Danbo 时间:2015-7-17 在runlevel3启动级别下默认启动网络挂载(autofs)机制,我们可以通过命令将其关闭:chkconfig autofs off 或者 /etc/in ...

随机推荐

  1. Unity3D 动态地创建识别图

    前面介绍了EasyAR的单图识别,它是提前在Unity设置好图片路径的,那么如果我们的图片是存储在服务器上的,那么我们肯定不能直接把服务的图片地址填上去了.这个时候我们可以动态地创建识别图.步骤如下: ...

  2. Python中类方法、__new__方法和__init__方法解析

    在编程语言中创建一个类,有构造方法这样的一个术语.而在Python中,通常大家都认为__init__是构造方法,其实并不完全等同.在构建类中,有一个特殊的方法__new__,这个才能等同为构造方法. ...

  3. 提高Interface Builder高效工作的8个技巧

    本文转载至 http://www.cocoachina.com/ios/20141106/10151.html iOS开发Interface Builder 本文译自:8 Tips for worki ...

  4. delphi 颜色 引用http://www.cnblogs.com/del/archive/2008/02/19/1073568.html

    颜色名称   颜色效果   Hex HTML clBlack   $000000 #000000 clMaroon   $000080 #800000 clGreen   $008000 #00800 ...

  5. 如何进行Web服务的性能测试?

    随着浏览器功能的不断完善,用户量不断的攀升,涉及到web服务的功能在不断的增加,对于我们测试来说,我们不仅要保证服务端功能的正确性,也要验证服务端程序的性能是否符合要求.那么性能测试都要做些什么呢?我 ...

  6. 九度OJ 1072:有多少不同的面值组合? (计数)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:3112 解决:1591 题目描述: 某人有8角的邮票5张,1元的邮票4张,1元8角的邮票6张,用这些邮票中的一张或若干张可以得到多少种不同的 ...

  7. sed命令使用举例

    选择操作的行范围 sed -n '1,2p' testsed2.txt  匹配第1到2行 sed -n '/a/,/b/p' testsed2.txt  匹配从包含a的行到包含b的行 sed -n ' ...

  8. 在tomcat下直接访问Html报错,说找不到资源(404)

    今天由于工作需要,想把一个html直接放到tomcat(干净的tomcat,没有做过任何修改.)下进行访问,然后根据经验就直接在webapps下创建了个文件夹test,然后把需要的test.html拷 ...

  9. (转)php 根据url自动生成缩略图并处理高并发问题

    分享是一种精神,与技术高低无关!   图片缩略图动态生成- [代码编程] 2011-08-23 版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://www.blogbus.c ...

  10. 使用diff制作补丁【学习笔记】

    源文件:main.c #include <stdio.h> int main() { printf("hello"); } 修改之后的文件: main1.c #incl ...