This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

/usr/lib/libc.so.1 as an interpreter


Hi,

I am getting /usr/lib/libc.so.1 as an interpreter in place of
/lib/ld-linux.so.2 on linux.

$ cat main.c
int
main()
{

	printf("Hello world");
}
When I build and run the above code as follows
$ gcc -c main.c
$ ld -o main main.o -lc
$ ./main
-bash: ./main: /usr/lib/libc.so.1: bad ELF interpreter: No such file or
directory
$ readelf -l main
Elf file type is EXEC (Executable file)
Entry point 0x80481d8
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: /usr/lib/libc.so.1]
  LOAD           0x000000 0x08048000 0x08048000 0x00228 0x00228 R E 0x1000
  LOAD           0x000228 0x08049228 0x08049228 0x000b4 0x000b4 RW  0x1000
  DYNAMIC        0x000228 0x08049228 0x08049228 0x000a0 0x000a0 RW  0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
----
----

Why the linker putting /usr/lib/libc.so.1 as an interpreter not putting
/lib/ld-linux.so.2 as an interpreter.
Is there anything else missing by me?
If I tried direct compiling as follows
$ gcc -o main main.c
Then its working fine and putting  /lib/ld-linux.so.2 as an interpreter.

Thanks

Thanks & Regards,
Bhushan



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]