|
|
SPECFILE=/tools/lib/gcc-lib/*/*/specs &&
sed -e 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
$SPECFILE > tempspecfile
mv tempspecfile $SPECFILE &&
unset SPECFILE
然后
rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h}
然后
echo 'main(){}' > dummy.c
gcc dummy.c
readelf -l a.out | grep ': /tools'
没有结果
readelf -l a.out
出现:
Elf file type is EXEC (Executable file)
Entry point 0x8048244
There are 6 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x08048034 0x08048034 0x000c0 0x000c0 R E 0x4
INTERP 0x0000f4 0x080480f4 0x080480f4 0x00013 0x00013 R 0x1
[Requesting program interpreter: /lib/ld-linux.so.2]
LOAD 0x000000 0x08048000 0x08048000 0x003b8 0x003b8 R E 0x1000
LOAD 0x0003b8 0x080493b8 0x080493b8 0x000fc 0x00100 RW 0x1000
DYNAMIC 0x0003c4 0x080493c4 0x080493c4 0x000c8 0x000c8 RW 0x4
NOTE 0x000108 0x08048108 0x08048108 0x00020 0x00020 R 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame
03 .data .dynamic .ctors .dtors .jcr .got .bss
04 .dynamic
05 .note.ABI-tag
中间有个输出是 [Requesting program interpreter: /lib/ld-linux.so.2]
在specs文件里/lib/ld-linux.so.2 已经改成/tools/lib/ld-linux.so.2了,可还是提示这个信息
请哪位高手指点一下,急
另
specs文件部分内容是
.......
*link:
%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} %{static:-static}}}
.....
只有这个地方有/tools/lib/ld-linux.so.2,其他地方没有ld-linux.so.2 |
|