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. lnmp建站常识

    1.nginx配置网站目录并修改访问的端口:nginx.conf文件 listen 666;//端口默认为80,修改后增强安全性 server_name www.lnmp.org; index ind ...

  2. struts2 Eclipse 中集成strust2开发框架实例

    下面通过建立一个小的实例具体来说明Eclipse 集成struts2,以下实例采用的为 struts2 版本为 struts2 2.2.3.1 为应用. 1. 下载struts2的开发包 第一步: 在 ...

  3. python classmethod方法 和 staticmethod

    classmethod() 是一个类方法,用来装饰对应的函数.被classmethod 装饰之后就无需实例化,也不需要在函数中传self,但是被装饰的函数第一个参数需要是cls来表示自身类.可以用来调 ...

  4. 自己珍藏的数据库SQL基础练习题答案

    一,基本表的定义与删除. 题1: 用SQL语句创建如下三张表:学生(Student),课程表(Course),和学生选课表(SC),这三张表的结构如表1-1到表1-3所示. 表1-1 Student表 ...

  5. 远程访问(HttpClient和HttpResponse的使用) 原型模式

    package com.webserver.webservice; import java.io.ByteArrayInputStream; import java.io.FileOutputStre ...

  6. Eclipse + JDK + tomcat开发环境配置

       第一步:下载jdk和tomcat:JDK下载  Tomcat下载     最新的jdk为1.6.10,tomcat为6.0,建议jdk1.4以上,tomcat4.0以上    第二步:安装和配置 ...

  7. 操作符表示指针指向的底层值 切片 nill 清空 按值引用赋值 获取地址赋值

    package main import "fmt" var thisVisitedUrls [] string func tf() { p := &thisVisitedU ...

  8. python数据分析之:绘图和可视化

    在数据分析领域,最出名的绘图工具就是matlib.在Python同样有类似的功能.就是matplotlib.前面几章我们都在介绍数据的生成,整理,存储.那么这一章将介绍如果图形化的呈现这些数据.来看下 ...

  9. 剑指Offer:字符串排列【38】

    剑指Offer:字符串排列[38] 题目描述 输入一个字符串,按字典序打印出该字符串中字符的所有排列.例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bc ...

  10. 登录令牌 Token 介绍

     Token值介绍 token 值: 登录令牌.利用 token 值来判断用户的登录状态.类似于 MD5 加密之后的长字符串. 用户登录成功之后,在后端(服务器端)会根据用户信息生成一个唯一的值.这个 ...