Re: [arm-gnu] arm-2007q3 and busybox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] arm-2007q3 and busybox



Paul Brook wrote:
I using Code Sourcery (arm-2007q3) tools with  uclibc to compile
busybox, but when I try to compile:

--- make ---
arm-uclinuxeabi-strip: busybox_unstripped: File format not recognized
make: ** [busybox] Erro 1


This is a bug in you busybox makefiles or config. Stripping a uClinux binary makes no sense as it is not an ELF image.

Paul


I'd like to share the same email that I asked in busybox maillist. Now I can see how makes no sense stripping an binary from uClinux, but I don't know why it does it...

----------------------------------------------------------

> Which version of busybox?

I'm using 1.10.0.

Now, for testing I:

1. make defconfig (just changing: ash -> hush) because I got: shell/ash.c:66:2: error: #error "Do not even bother, ash will not run on uClinux

2. Edit ARCH and CROSS_COMPILER in Makefile

> Wow, your "strip" doesn't recognize the binary! :)
>
> Well, you can just "cp busybox_unstripped busybox" and use
> unstripped binary.

After the same error, it results, in two files:

* busybox_unstripped
* busybox_unstripped.gdb

# file busybox_unstripped
busybox_unstripped: BFLT executable - version 4 ram

# file busybox_unstripped.gdb
busybox_unstripped.gdb: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped

>
> What these command say? (Example is from my x86 machine):

With readelf I could extract information only from busybox_unstripped.gdb


# readelf -h busybox_unstripped.gdb
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:               0x4
  Start of program headers:          52 (bytes into file)
  Start of section headers:          888432 (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:         4
  Size of section headers:           40 (bytes)
  Number of section headers:         16
  Section header string table index: 13


But, I think, with QEMU (qemu-arm) I could run:

# qemu-arm busybox_unstripped
BusyBox v1.10.0 (2008-04-12 17:35:40 BRT) multi-call binary
Copyright (C) 1998-2007 Erik Andersen, Rob Landley, Denys Vlasenko

# qemu-arm busybox_unstripped.gdb
qemu: uncaught target signal 11 (Segmentation fault) - exiting

Observation: With CodeSourcery toolchain (arm-none-linux-gnueabi-) that links against glibc the busybox compilation (defconfig) works fine.


I'd like to know more about stripped binaries, these are only for getting metadata from compiled files? Why it didn't work on a toolchain with uclibc ?

It's correct these outputs?

Thanks,
Tiago Maluta
----------------------------------------------------------

--
tiago