这里的C:\MinGW\bin需要根据实际安装路径进行修改。 4. 进入Binutils的安装目录,并使用下面的命令进行LD ELF_i386仿真: ld -m elf_i386 -o output input 其中,output为输出文件名称,input为需要进行仿真的ELF格式文件名称。 至于为什么LD只提供了i386pe仿真,可能是因为ELF_i386不是Windows下的主要可执行文件格式,...
ld: i386 architecture of input file `TinyHelloWorld.o' is incompatible with i386:x86-64 output 问题原因: 输入目标文件`TinyHelloWorld.o’是32位系统的,然而我们的平台是64位的(默认链接脚本位于/usr/lib/ldscripts下,x86_64平台默认链接64位可执行文件用的是elf_x86_64.x,链接32位可执行文件用的是elf3...
-m:指定链接的机器类型,例如 -m elf_i386 用于生成 32 位 x86 架构的可执行文件。 -shared:生成共享库文件,而不是可执行文件。 -fPIC:生成位置无关代码(Position Independent Code),适用于共享库。 -dynamic-linker:指定动态链接器路径,例如 /lib/ld-linux.so.2。 -L:指定库文件的搜索路径。 -l:链接指定...
1 ld -m elf_i386 -s -o foobar foo.o bar.o 具体的-m32 和 -m elf_i386 请自行查阅gcc (man gcc) 如果你是高版本的gcc(可能是由于更新内核造成的),可能简单的使用-m32 的时候会提示以下错误(使用别人的历程,自己未曾遇到): > In file included from /usr/include/stdio.h:28:0, > from test....
GNU ld (GNU Binutils for Ubuntu) 2.38 Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe using internal linker script: === /* Script for -z combreloc -z separate-code */ /* Copyright (C) 2014-2022 Free Software Foundation, Inc. ...
ld file.o -o output -m elf_i386 指定输出文件使用的文件格式,例如此处指定为32位的ELF格式。 8. 连接时不进行符号解析: ld file.o -o output -r 使用-r选项告诉ld在链接时不进行符号解析,生成一个可重定位文件。 9. 显示链接地址和大小:
它是GNU binary utils的一部分,有两个版本:传统的基于BFD& 只支持 ELF 的gold。(gold 由 Google 团队研发,2008 年被纳入 GNU binary utils。目前随着 Google 重心放到 llvm 的lld上,gold 几乎不怎么维护了)。 ld 的命名据说是来自LoaDer、Link eDitor。
目标文件(包括可执行文件)具有固定的格式, 在UNIX或GNU/Linux平台下, 一般为ELF格式。若想了解更多, 可参考 UNIX/Linux平台可执行文件格式分析。 有时把输入文件内的section称为输入section(input section), 把输出文件内的section称为输出section(output sectin)。
ld-linux-x86-64.so.2: bad elf interpreter: no such file or directory 这个错误通常表明系统试图执行一个二进制文件,但该文件指定的动态链接器(dynamic linker/loader)ld-linux-x86-64.so.2 不存在。以下是针对这个问题的详细解答: 1. 确认错误信息来源 这个错误通常出现在以下几种场景: 系统文件被误删除:...
报错:ld: i386 架构于输入文件 foo.o 与 i386:x86-64 输出不兼容 或者:ld: i386 architecture of input file `foo.o' is incompatible with i386:x86-64 output 编译链接指令 1 1 nasm-f elf foo.s -o foo.o 2 1 gcc-c bar.c -o bar.o ...