相关疑难解决方法(0)

GCC编译错误,代码大于2 GB

我有大量的功能,总共大约2.8 GB的目标代码(遗憾的是,没有办法,科学计算......)

当我尝试链接它们时,我得到(预期的)relocation truncated to fit: R_X86_64_32S错误,我希望通过指定编译器标志来避免这些错误-mcmodel=medium.我控制的所有链接的库都使用该-fpic标志进行编译.

仍然,错误仍然存​​在,我认为我链接到的一些库不是用PIC编译的.

这是错误:

/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x12): relocation truncated to fit: R_X86_64_32S against symbol `__libc_csu_fini'     defined in .text section in /usr/lib64/libc_nonshared.a(elf-init.oS)
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x19): relocation truncated to fit: R_X86_64_32S against symbol `__libc_csu_init'    defined in .text section in /usr/lib64/libc_nonshared.a(elf-init.oS)
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o: In function    `call_gmon_start':
(.text+0x7): relocation truncated to fit: R_X86_64_GOTPCREL against undefined symbol      `__gmon_start__'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbegin.o: In function `__do_global_dtors_aux': …
Run Code Online (Sandbox Code Playgroud)

c c++ gcc compiler-errors

108
推荐指数
6
解决办法
2万
查看次数

C语句的最大语句长度

C中定义的语句是否有最大长度?

编译器是gcc

c gcc

5
推荐指数
2
解决办法
3987
查看次数

标签 统计

c ×2

gcc ×2

c++ ×1

compiler-errors ×1