相关疑难解决方法(0)

如何从源代码编译我自己的glibc C标准库并使用它?

我正在尝试编译自己的glibc.我有一个目录glibc,其中包含glibc我从互联网上下载的源代码.从我输入的目录中输入mkdir ../build-glibc.现在从build-glibc我输入的目录../glibc/configure中执行配置.现在我不知道怎么打电话make.我无法从glibc目录中调用它,因为它没有配置集,也不能从中调用它build-glibc,因为makefile不在该目录中.我该如何解决这个问题?

c linux gcc glibc x86-64

11
推荐指数
2
解决办法
1万
查看次数

在x86_64 linux中重定位程序超过2GB的链接器错误?

我有一个用户程序,通常编译为有一个入口点0x400460,我必须重新定位,以便2GB在Linux中加载的共享库中有一个入口点.例如linux-vdso.so.1 => (0x00007fff109cd000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcd195e6000) /lib64/ld-linux-x86-64.so.2 (0x00007fcd199af000)

我使用gcc命令行参数-Wl,-Ttext=0x80000000来指定.textsegemnt 的起始地址.

问题是当我2GB在这个参数中给出一个上面的地址时,我得到一个链接器错误,它是:

gcc test.c -ggdb -Wl,-Ttext=0x80000000 -o test1
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 10
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 10
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 …
Run Code Online (Sandbox Code Playgroud)

c linux linker gcc x86-64

6
推荐指数
1
解决办法
6224
查看次数

标签 统计

c ×2

gcc ×2

linux ×2

x86-64 ×2

glibc ×1

linker ×1