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. YII框架学习(一)

    1.安装: windows:将php命令所在的文件夹路径加入到环境变量中,通过cmd命令:进入yii框架中的framework目录,执行: php yiic webapp ../cms linux:类 ...

  2. android菜鸟学习笔记5----第一个android程序

    程序功能:点击一个按钮,然后弹出一个提示信息 Step 1:在eclipse中新建一个android application project,在创建过程中不勾选create activity,这样就创 ...

  3. C#单元测试(转)

    C#,单元测试入门(以下内容可能来自网络) 一.什么叫单元测试(unit testing)? 是指对软件中的最小可测试单元进行检查和验证.对于单元测试中单元的含义,一般来说,要根据实际情况去判定其具体 ...

  4. Channel (digital image) 通道 色彩深度 Color_depth

    en.wikipedia.org/wiki/Channel_(digital_image) Color digital images are made of pixels, and pixels ar ...

  5. plus.os.name 无法正确执行的问题

    使用HTML5+开发App的时候, 如果碰到正确的代码却无法出现预期的执行效果, 请检查模块权限配置是否OK? 比如plus.os.name, 需要Device权限 ;

  6. Java反射机制简单学习

    java中除了基本数据类型,几乎都为对象.例如 Person p=new Person(); 这句语句表明了p是Person类的一个实例对象.但其实,Person也是一个实例对象,它是Class类的实 ...

  7. centos7 执行一个数据库脚本创建项目中的数据库

    [root@localhost ~]# su postgres 切换用户 bash-4.2$ psql could not change directory to "/root": ...

  8. Java中synchronized

    原文地址 synchronized是Java中的关键字,是一种同步锁.它修饰的对象有以下几种:1. 修饰一个代码块,被修饰的代码块称为同步语句块,其作用的范围是大括号{}括起来的代码,作用的对象是调用 ...

  9. SPOJ - PHRASES Relevant Phrases of Annihilation —— 后缀数组 出现于所有字符串中两次且不重叠的最长公共子串

    题目链接:https://vjudge.net/problem/SPOJ-PHRASES PHRASES - Relevant Phrases of Annihilation no tags  You ...

  10. 加州小学grade1,学习计划

    Visual vocabulary Grammar Spelling Maths Chapter 1 Patterns and Number SenseChapter 2Understanding A ...