This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Linker problem to create .interp section
- From: "Bhushan Verma" <bhushan dot verma at iap-online dot com>
- To: <binutils at sourceware dot org>
- Date: Wed, 18 Jun 2008 19:46:21 +0900
- Subject: Linker problem to create .interp section
Hi,
I just tried to run a shared object on linux using GNU toolchain.
#gcc -o func.so -shared -fpic -Wl,-e,func -Wl,-I,/lib/ld-linux.so.2 func.c
#./func.so
segmentation fault
# readelf -l func.so
Elf file type is DYN (Shared object file)
Entry point 0x47c
There are 5 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00000000 0x00000000 0x00548 0x00548 R E 0x1000
LOAD 0x000548 0x00001548 0x00001548 0x00104 0x0010c RW 0x1000
DYNAMIC 0x000560 0x00001560 0x00001560 0x000c0 0x000c0 RW 0x4
NOTE 0x0000d4 0x000000d4 0x000000d4 0x00024 0x00024 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
Section to Segment mapping:
Segment Sections...
00 .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version
.gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame
01 .ctors .dtors .jcr .data.rel.ro .dynamic .got .got.plt .bss
02 .dynamic
03 .note.gnu.build-id
04
In linker manual following is mentioned.
-I PROGRAM, --dynamic-linker PROGRAM
Set PROGRAM as the dynamic linker to use
Now my question is why linker is not setting the dynamic linker using above
command.
Thanks & Regards,
Bhushan