使用ld链接器出现cannot find entry symbol __start问题

trazqian trazqian 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我在使用链接器时发生错如下,不知道怎么解决,期待高手指教!
./ld -s -o exe ji4.o gebp.o main.o
./ld: warning: cannot find entry symbol __start; defaulting to 00000000100000c0
main.o: In function `main':
main1.c:(.text+0x34): undefined reference to `atoi'
main1.c:(.text+0x54): undefined reference to `atoi'
main1.c:(.text+0x74): undefined reference to `atoi'
main1.c:(.text+0x94): undefined reference to `atoi'
main1.c:(.text+0xbc): undefined reference to `atoi'
main.o:main1.c:(.text+0xe4): more undefined references to `atoi' follow
main.o: In function `set_Matrix':
main1.c:(.text+0x1c8): undefined reference to `rand'
main.o: In function `test_Goto':
main1.c:(.text+0x2e8): undefined reference to `malloc'
main1.c:(.text+0x304): undefined reference to `malloc'
main1.c:(.text+0x320): undefined reference to `malloc'
main1.c:(.text+0x35c): undefined reference to `puts'
main1.c:(.text+0x36c): undefined reference to `exit'
main1.c:(.text+0x37c): undefined reference to `time'
main1.c:(.text+0x38c): undefined reference to `srand'
main1.c:(.text+0x448): undefined reference to `gettimeofday'
main1.c:(.text+0x4a8): undefined reference to `gettimeofday'
main1.c:(.text+0x544): undefined reference to `printf'
main1.c:(.text+0x554): undefined reference to `free'
main1.c:(.text+0x564): undefined reference to `free'
main1.c:(.text+0x574): undefined reference to `free'
main.o: In function `comp_DGEMM':
main1.c:(.text+0xf44): undefined reference to `gettimeofday'
main1.c:(.text+0xfa4): undefined reference to `gettimeofday'
main1.c:(.text+0x1080): undefined reference to `printf'
...全文

相关推荐

CTF逆向实战:从UPX手动脱壳到内存转储与ELF修复

逆向工程是信息安全领域的核心技术之一,涉及对软件内部逻辑与结构的分析。其核心原理在于通过静态与动态分析,理解程序的执行流程与数据交互。掌握逆向技能对于漏洞挖掘、恶意软件分析和软件保护评估具有重要价值,尤其在CTF竞赛和实际安全工作中应用广泛。本文聚焦于逆向工程中的基础且关键的环节——手动脱壳,以常见的UPX压缩壳为例,详细演示了在Linux环境下使用GDB调试器定位原始入口点(OEP)、进行内存转储,并利用objcopy和链接器修复ELF文件的全过程。通过结合GDB调试与内存转储技术,读者可以深入理解程序在

weixin_33922670

IAR集成NXP S32 Design Studio:编译器配置、调试与固件部署实战

在嵌入式开发中,IDE与编译器的选型直接影响代码效率与调试体验。IAR Embedded Workbench以其对Cortex-M内核的深度优化而著称,而NXP S32 Design Studio作为官方Eclipse集成环境,提供了完善的芯片支持与图形化配置工具。将两者结合,相当于在统一工作流中同时获得IAR的编译质量和NXP的硬件适配能力。本文从工具链原理切入,讲解如何在S32DS中注册IAR编译器、处理启动文件与链接脚本差异、配置J-Link调试,并深入S32K344多核调试与bootloader场景

自我修炼的小石头

Linux ELF文件解析实战:file、readelf、objdump工具链排查指南

ELF是Linux下可执行文件、共享库与目标文件的统一容器格式,理解其文件头、节区表、程序头与动态节区结构,是排查二进制问题的核心基础。通过file、readelf、objdump等工具链,可快速识别文件架构、依赖库、符号表与重定位信息,有效定位bad ELF interpreter、动态库缺失、符号冲突等常见故障。掌握这套方法,能在跨平台部署、线上服务启动失败、二进制体积优化等场景中显著提升排查效率。本文围绕ELF结构原理与工具链协同,系统梳理从定性到定量的完整排查路径。

小鹅通

STM32烧录报错排查:从编译到ST-Link链接的全流程指南

嵌入式开发中,单片机程序的编译与烧录是每个开发者必须掌握的核心链路。理解从源码到固件文件的转换过程,包括预编译、编译、汇编、链接等阶段,以及启动文件和链接脚本的作用,是定位烧录失败的基石。ST-Link作为常用的调试烧录工具,其连接稳定性直接影响开发效率。当出现“no STM32 target found”等经典报错时,往往源于供电不足、接线错误、驱动异常或芯片读保护状态。通过系统排查SWD接线、驱动安装、启动模式及选项字节配置,多数问题可快速解决。本文结合工程实践,梳理从开发环境搭建、HAL库选型、编译链

cigang4063

fengmian123

fengmian123

CiYuanShuos
评论 8
收藏 已收藏
分享
返回顶部
trazqian
Linux/Unix社区 23,224 成员 74,535 内容