[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#922280: marked as done (Wrong name of dynamic linker is in binaries cross-compiled by arm-gcc.)



Your message dated Thu, 14 Feb 2019 23:38:46 +0800
with message-id <E6BFE81D-645E-4B9F-B8B9-DD53225D423E@gmail.com>
and subject line Re: Bug#922280: Acknowledgement (Wrong name of dynamic linker is in binaries cross-compiled by arm-gcc.)
has caused the Debian Bug report #922280,
regarding Wrong name of dynamic linker is in binaries cross-compiled by arm-gcc.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
922280: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922280
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-arm-linux-gnueabi
Version: 6.3.0-4 

The name of dynamic linker of binaries cross-compiled by arm-gcc is 
`/lib/ld-linux.so.3`.

```
# # on an amd64 machine
# echo "int main(){ return 0; }" > test.c
# arm-linux-gnueabi-gcc test.c -o test
# env LC_ALL=C arm-linux-gnueabi-readelf -l test

Elf file type is DYN (Shared object file)
Entry point 0x464
There are 9 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x0006cc 0x000006cc 0x000006cc 0x00008 0x00008 R   0x4
  PHDR           0x000034 0x00000034 0x00000034 0x00120 0x00120 R E 0x4
  INTERP         0x000154 0x00000154 0x00000154 0x00013 0x00013 R   0x1
      [Requesting program interpreter: /lib/ld-linux.so.3]
  LOAD           0x000000 0x00000000 0x00000000 0x006d8 0x006d8 R E 0x10000
  LOAD           0x000f04 0x00010f04 0x00010f04 0x00140 0x00144 RW  0x10000
  DYNAMIC        0x000f10 0x00010f10 0x00010f10 0x000f0 0x000f0 RW  0x4
  NOTE           0x000168 0x00000168 0x00000168 0x00044 0x00044 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x10
  GNU_RELRO      0x000f04 0x00010f04 0x00010f04 0x000fc 0x000fc R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     .ARM.exidx 
   01     
   02     .interp 
   03     .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 
   04     .init_array .fini_array .jcr .dynamic .got .data .bss 
   05     .dynamic 
   06     .note.ABI-tag .note.gnu.build-id 
   07     
   08     .init_array .fini_array .jcr .dynamic 
```

However, in debian-armhf, the dynamic linker should be 
`/lib/ld-linux-armhf.so.3`.

```
# # on an armhf machine
# readelf -l /bin/true 

Elf file type is DYN (Shared object file)
Entry point 0x109d
There are 9 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x004060 0x00004060 0x00004060 0x00008 0x00008 R   0x4
  PHDR           0x000034 0x00000034 0x00000034 0x00120 0x00120 R E 0x4
  INTERP         0x000154 0x00000154 0x00000154 0x00019 0x00019 R   0x1
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
  LOAD           0x000000 0x00000000 0x00000000 0x0406c 0x0406c R E 0x10000
  LOAD           0x004ed0 0x00014ed0 0x00014ed0 0x002d8 0x0041c RW  0x10000
  DYNAMIC        0x004f08 0x00014f08 0x00014f08 0x000f8 0x000f8 RW  0x4
  NOTE           0x000170 0x00000170 0x00000170 0x00044 0x00044 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x10
  GNU_RELRO      0x004ed0 0x00014ed0 0x00014ed0 0x00130 0x00130 R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     .ARM.exidx 
   01     
   02     .interp 
   03     .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 
   04     .init_array .fini_array .jcr .data.rel.ro .dynamic .got .data .bss 
   05     .dynamic 
   06     .note.ABI-tag .note.gnu.build-id 
   07     
   08     .init_array .fini_array .jcr .data.rel.ro .dynamic 
```

When I copy the cross-compiled binary to an armhf machine, the 
executable cannot get executed.

```
# ./test 
/lib/ld-linux.so.3: No such file or directory
```

I wonder whether it is a bug or left on purpose.

--- End Message ---
--- Begin Message ---
After looking into the problem deeply, I found that I've used a wrong 
compiler. The right one should be `gcc-arm-linux-gnueabihf`.

Just for reference, there are three architectures: armel, armhf and 
arm64 in Debian package archive about arm, and the corresponding 
compilers should be gcc-arm-linux-gnueabi, gcc-arm-linux-gnueabihf,
and gcc-aarch64-linux-gnu.

--- End Message ---

Reply to: