lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 2 Apr 2022 23:14:43 +0100 (BST)
From:   "Maciej W. Rozycki" <macro@...am.me.uk>
To:     James Jones <linux@...innocuous.com>
cc:     Kees Cook <keescook@...omium.org>, bp@...en8.de, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: Remove a.out support

On Wed, 16 Mar 2022, James Jones wrote:

> Probably getting a bit off topic, but I did spend a few hours searching
> around for any existing tools to convert a binary from a.out->ELF, and
> trying to come up with something myself by extracting the sections with
> objdump and re-combining them into an ELF using a linker script placing
> the sections at the same locations. I couldn't get it working in an
> evening or two messing with it so I moved on, but I agree something like
> this seems possible in theory.

 Chiming in late as I'm scanning outstanding mailing list traffic: if this 
is as you say all statically linked stuff, then converting from a.out to 
ELF might be as easy as:

$ objcopy -I a.out-i386-linux -O elf32-i386 a.out-binary elf-binary

though you may have to build yourself suitably old i386-linux-gnu binutils 
(from ftp.gnu.org), e.g. this version does support a.out:

$ objcopy --info
BFD header file version 2.15.91 20040527
elf32-i386
 (header little endian, data little endian)
  i386
a.out-i386-linux
 (header little endian, data little endian)
  i386
efi-app-ia32
 (header little endian, data little endian)
  i386
elf32-little
 (header little endian, data little endian)
  i386
elf32-big
 (header big endian, data big endian)
  i386
srec
 (header endianness unknown, data endianness unknown)
  i386
symbolsrec
 (header endianness unknown, data endianness unknown)
  i386
tekhex
 (header endianness unknown, data endianness unknown)
  i386
binary
 (header endianness unknown, data endianness unknown)
  i386
ihex
 (header endianness unknown, data endianness unknown)
  i386
trad-core
 (header endianness unknown, data endianness unknown)

               elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big 
          i386 elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big 

               srec symbolsrec tekhex binary ihex trad-core 
          i386 srec symbolsrec tekhex binary ihex --------- 

The last binutils version to support a.out-i386-linux was 2.30 I believe.  
Just configuring for i386-linux-gnu should do as a.out used to be included 
as a secondary BFD target (you can also do `--enable-targets=all' to get 
support for all kinds of the exotic and less exotic BFD targets).

 HTH,

  Maciej

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ