gpt4 book ai didi

c - 如何制作假代理导入库

转载 作者:太空宇宙 更新时间:2023-11-04 04:20:30 24 4
gpt4 key购买 nike

我记得找到 *.a 库,它不包含任何对象,而是一个列表库(作为纯文本?),类似于:-liconv -lm

这样当 gcc 遇到它时,将搜索两个库以进行链接。

有这样的技巧吗?很确定当时它能正常工作,但我现在不知道该怎么做。

最佳答案

您的链接器是来自 binutils 的吗? binutils ld 支持 .a 文件为 implicit linker scripts :

If you specify a linker input file which the linker can not recognize as an object file or an archive file, it will try to read the file as a linker script. If the file can not be parsed as a linker script, the linker will report an error.

链接描述文件不必很复杂,它可以像这样简单(对于glibc的libc.so):

/* GNU ld script.  */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( …/libc.so.6 …/libc_nonshared.a AS_NEEDED ( …/ld-linux-x86-64.so.2 ) )

或者你可以只use INPUT to delegate things to ld :

If you use ‘INPUT (-lfile)’, ld will transform the name to libfile.a, as with the command line argument ‘-l’.

关于c - 如何制作假代理导入库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47483459/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com