Host strip corrupts cross-built armel archives

Bug #615765 reported by Peter Pearse on 2010-08-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Binutils
Won't Fix
Medium
Unassigned
binutils (Ubuntu)
Medium
Marcin Juszkiewicz
Maverick
Medium
Marcin Juszkiewicz

Bug Description

Binary package hint: binutils

$ ls -lrt /var/cache/apt/archives/binutils*
-rw-r--r-- 1 root root 2204364 2010-07-11 09:05 /var/cache/apt/archives/binutils_2.20.51.20100710-1ubuntu2_i386.deb
-rw-r--r-- 1 root root 6163090 2010-07-20 08:38 /var/cache/apt/archives/binutils-arm-linux-gnueabi_2.20.51.20100710-1ubuntu2hrw1_i386.deb

$ strip --version
GNU strip (GNU Binutils for Ubuntu) 2.20.51-system.20100710

$ ls -lrt /var/cache/apt/archives | grep gnueabi
-rw-r--r-- 1 root root 6163090 2010-07-20 08:38 binutils-arm-linux-gnueabi_2.20.51.20100710-1ubuntu2hrw1_i386.deb
-rw-r--r-- 1 root root 121718 2010-08-04 11:14 gcc-4.4-arm-linux-gnueabi-base_4.4.4-8ubuntu1hrw1_i386.deb
-rw-r--r-- 1 root root 3548230 2010-08-04 11:15 cpp-4.4-arm-linux-gnueabi_4.4.4-8ubuntu1hrw1_i386.deb
-rw-r--r-- 1 root root 704076 2010-08-04 11:15 gcc-4.4-arm-linux-gnueabi_4.4.4-8ubuntu1hrw1_i386.deb
-rw-r--r-- 1 root root 119156 2010-08-04 11:30 gcc-4.5-arm-linux-gnueabi-base_4.5.1-1ubuntu1hrw1_i386.deb

cat /etc/apt/sources.list

deb mirror://mirrors.ubuntu.com/mirrors.txt maverick main restricted universe multiverse
deb-src mirror://mirrors.ubuntu.com/mirrors.txt maverick main restricted universe multiverse

deb http://people.canonical.com/~hrw/ubuntu-maverick-armel-cross-compilers/ ./
deb-src http://people.canonical.com/~hrw/ubuntu-maverick-armel-cross-compilers/ ./

$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.4.4-8ubuntu1hrw1) 4.4.5 20100728 (prerelease)

$ cat test.c
int main (int argc, char** argv)
{
 return 0;
}

$ arm-linux-gnueabi-gcc -o test.o test.c
$ ls -l test.o
-rwxr-xr-x 1 chroot-user chroot-user 4693 2010-08-10 08:25 test.o

$ arm-linux-gnueabi-ar rc my.a test.o
$ ls -l my.a
-rw-r--r-- 1 chroot-user chroot-user 5072 2010-08-10 08:26 my.a
$ readelf -h my.a

File: my.a(test.o)
ELF Header:
  Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class: ELF32
  Data: 2's complement, little endian
  Version: 1 (current)
  OS/ABI: UNIX - System V
  ABI Version: 0
  Type: EXEC (Executable file)
  Machine: ARM
  Version: 0x1
  Entry point address: 0x82b9
  Start of program headers: 52 (bytes into file)
  Start of section headers: 1644 (bytes into file)
  Flags: 0x5000002, has entry point, Version5 EABI
  Size of this header: 52 (bytes)
  Size of program headers: 32 (bytes)
  Number of program headers: 8
  Size of section headers: 40 (bytes)
  Number of section headers: 29
  Section header string table index: 26

$ strip my.a
$ readelf -h my.a

File: my.a(test.o)
ELF Header:
  Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class: ELF32
  Data: 2's complement, little endian
  Version: 1 (current)
  OS/ABI: UNIX - System V
  ABI Version: 0
  Type: EXEC (Executable file)
  Machine: None ** Changed **
  Version: 0x1
  Entry point address: 0x82b9
  Start of program headers: 52 (bytes into file)
  Start of section headers: 1628 (bytes into file)
  Flags: 0x5000002
  Size of this header: 52 (bytes)
  Size of program headers: 32 (bytes)
  Number of program headers: 8
  Size of section headers: 40 (bytes)
  Number of section headers: 27
  Section header string table index: 26

$ ls -l my.a
-rw-r--r-- 1 chroot-user chroot-user 2840 2010-08-10 08:27 my.a

binutils-multiarch/strip does not exhibit this behaviour.

$ sudo apt-get install binutils-multiarch
......

$ arm-linux-gnueabi-gcc -o test.o test.c
$ arm-linux-gnueabi-ar rc my.a test.o
$ strip my.a
$ readelf -h my.a

File: my.a(test.o)
ELF Header:
  Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class: ELF32
  Data: 2's complement, little endian
  Version: 1 (current)
  OS/ABI: UNIX - System V
  ABI Version: 0
  Type: EXEC (Executable file)
  Machine: ARM
  Version: 0x1
  Entry point address: 0x82b9
  Start of program headers: 52 (bytes into file)
  Start of section headers: 1628 (bytes into file)
  Flags: 0x5000002, has entry point, Version5 EABI
  Size of this header: 52 (bytes)
  Size of program headers: 32 (bytes)
  Number of program headers: 8
  Size of section headers: 40 (bytes)
  Number of section headers: 27
  Section header string table index: 26

$ ls -l my.a
-rw-r--r-- 1 chroot-user chroot-user 2840 2010-08-10 08:44 my.a

Debian http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=211052 may be relevant.

Steve Langasek (vorlon) wrote :

AIUI this is a blocker for cross-toolchan work in Linaro, so setting an appropriate milestone target.

Marcin, is this something you can look into?

Changed in binutils (Ubuntu Maverick):
milestone: none → ubuntu-10.10
assignee: nobody → Marcin Juszkiewicz (hrw)
importance: Undecided → Medium
milestone: ubuntu-10.10 → none
Steve Langasek (vorlon) on 2010-08-11
Changed in binutils (Ubuntu Maverick):
milestone: none → ubuntu-10.10
Steve Langasek (vorlon) on 2010-08-12
tags: added: linaro
Loïc Minier (lool) on 2010-08-19
tags: added: armel toolchain
Michael Hope (michaelh1) on 2010-08-23
summary: - strip corrupts armel archives
+ Host strip corrupts cross-built armel archives
Marcin Juszkiewicz (hrw) wrote :

From strip.single perspective all looks ok. It sees [elf32-little] and proceeds with stripping not needed sections. strip.multiarch recognises [elf32-littlearm] so know more how to do work.

Loïc Minier (lool) wrote :

Mark Mitchell confirmed that this is really a binutils bug.

Changed in binutils-linaro:
importance: Undecided → Medium
Changed in binutils (Ubuntu Maverick):
milestone: ubuntu-10.10 → maverick-updates
Steve Langasek (vorlon) on 2011-02-15
tags: added: arm-porting-queue
Matthias Klose (doko) wrote :

closing, maverick isn't supported anymore

Changed in binutils (Ubuntu):
milestone: maverick-updates → none
status: New → Won't Fix
Changed in binutils-linaro:
status: New → Triaged
Marcin Juszkiewicz (hrw) on 2013-05-31
Changed in binutils (Ubuntu Maverick):
status: New → Won't Fix
Changed in binutils-linaro:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers