32bit / 64bit co-exist Linux, ld-linux.so, linux-gate.so.1 etc
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的更多相关文章
- Linux入门基础(一):Linux基本操作
命令行BASH基本操作 Shell 用户不能直接操作内核,所以用户操作通过shell传递给内核 shell分为两种 : GUI 图形界面 (linux一般是GNOME) CLI 命令行界面 (linu ...
- 【转】如何查看linux版本 如何查看LINUX是多少位
原文网址:http://sopace.blog.51cto.com/1227753/670526 如何得知自己正在使用的linux是什么版本呢,下面的几种方法将给你带来答案! 1. 查看内核版本命令: ...
- 如何确定一台linux主机是Linux (i386/i686)还是Linux (x86_64)
在下软件包的时候,往往会遇到一个选择: 假设自己的主机是Linux,那么Linux (i386/i686)和Linux (x86_64)究竟应该选哪一个呢? 针对当今的硬件而言,如果你主机的CPU是6 ...
- 【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 ...
- Linux Kernel - Debug Guide (Linux内核调试指南 )
http://blog.csdn.net/blizmax6/article/details/6747601 linux内核调试指南 一些前言 作者前言 知识从哪里来 为什么撰写本文档 为什么需要汇编级 ...
- 装机预备技能,Linux系统简介,安装Linux系统,Linux基本操作-云计算学习(2)
装机预备技能 问题 要求安装一台可用的KVM服务器: RHEL与CentOS系统有什么关联? Linux系统中第三块SCSI硬盘如何表示? 步骤 实现此案例需要按照如下步骤进行. 步骤一:RHEL系统 ...
- 嵌入式Linux开发教程:Linux常见命令(上篇)
摘要:这是对周立功编著的<嵌入式Linux开发教程>的第7期连载.本期刊载内容有关LinuxLinux常见命令中的导航命令.目录命令和文件命令.下一期将连载网络操作命令.安装卸载文件系统等 ...
- Linux中断管理 (1)Linux中断管理机制
目录: <Linux中断管理> <Linux中断管理 (1)Linux中断管理机制> <Linux中断管理 (2)软中断和tasklet> <Linux中断管 ...
- [中英对照]Linux kernel coding style | Linux内核编码风格
Linux kernel coding style | Linux内核编码风格 This is a short document describing the preferred coding sty ...
- Linux随笔-鸟哥Linux服务器篇学习总结(全)
作者:Danbo 时间:2015-7-17 在runlevel3启动级别下默认启动网络挂载(autofs)机制,我们可以通过命令将其关闭:chkconfig autofs off 或者 /etc/in ...
随机推荐
- Ubuntu 12.04中文输入法的安装(zhuan)
Ubuntu 12.04中文输入法的安装 Ubuntu上的输入法主要有小小输入平台(支持拼音/二笔/五笔等),Fcitx,Ibus,Scim等.其中Scim和Ibus是输入法框架. 在Ubuntu ...
- H2 应用实例2
DIY 博客全文界面的推荐.反对.加关注.返回顶部.快速评论等小功能的集成 --> 转载 :一.搭建测试环境和项目 1.1.搭建JavaWeb测试项目 创建一个[H2DBTest]JavaWeb ...
- 大家都是怎么看待STO的?
STO,全称为「Security Token Offer」,即证券型通证发行.STO是2017年底从美国开始流行的,对于在美国注册的公司,STO是一个合法合规的ICO. 对于STO,大家都是怎么看待的 ...
- lambda map filter 用法
lambda 可以这样认为,lambda作为一个表达式 非常容易理解,在这里lambda简化了函数定义的书写形式.是代码更为简洁,但是使用函数的定义方式更为直观,易理解. #定义函数:普通方式 def ...
- Qt — tableWidget插入复选框
之前不太了解Qt中的相关控件,一直尝试直接在tableview上增加复选框. 但相对来说,在tableview增加复选框的工作量与麻烦程度远超tableWidget. 接下来是如何在Qt的tableW ...
- Java for LeetCode 121 Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were ...
- ZOJ - 4020 Traffic Light 【BFS】
题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4020 题意 给出一张地图 以及起点和终点 求是否能从起点走到终点 ...
- Matlab图像处理(01)-Matlab基础
枫竹梦对于Matlab几乎是零基础,只是在上学的时候稍稍接触一点,万万没有想到现在还能用到Matlab.进入正题>>> 图像的基本概念 一幅图像可以被定义为一个二维函数f(x,y), ...
- initcall_debug简要说明【转】
本文转载自:https://blog.csdn.net/zangdongming/article/details/37769265 Linux version 3.10.40 1. 使用说明 Docu ...
- 分享知识-快乐自己:Java 中 的String,StringBuilder,StringBuffer三者的区别
这三个类之间的区别主要是在两个方面,即运行速度和线程安全这两方面. 1):首先说运行速度,或者说是执行速度,在这方面运行速度快慢为:StringBuilder > StringBuffer &g ...