[GSOC 2014] Multiarch: runtime error

Dmitry V. Levin ldv at altlinux.org
Tue Jul 1 00:41:58 UTC 2014


Hi Edson,

On Mon, Jun 30, 2014 at 06:34:28PM -0500, Edson Ticona wrote:
> Hi
> I could convert i386 binary to x86_64 by using:
> objcopy -O elf64-x86-64 sigaltstack-i386.i sigaltstack-x86_64.i

Conversion of an elf32-i386 format object to an elf64-x86-64 format object
doesn't convert x86 code to x86_64 code.

> then, compiling goes fine like this:
> gcc -Wall -Wwrite-strings -g -O2   -o strace aio.o bjm.o block.o
> count.o desc.o fanotify.o file.o inotify.o io.o ioctl.o ioprio.o ipc.o
> kexec.o keyctl.o ldt.o loop.o mem.o mtd.o net.o pathtrace.o process.o
> ptp.o quota.o reboot.o resource.o scsi.o signal.o sigaltstack.o
> sigaltstack-x86_64.i sock.o strace.o stream.o syscall.o system.o
> term.o time.o util.o vsprintf.o

BTW, what are sigaltstack-i386.i and sigaltstack-x86_64.i?

Traditionally, *.i files are C source code files that should not be
preprocessed, but you use them as if they were object files to be fed
straight into linking.

> However, I get a SIGSEGV on execution time. What could be causing it?

Looks like you are trying to use an x86 code as an x86_64 code in an
elf64-x86-64 executable.  Unless you take special measures, it won't work,
and it's hard to imagine a situation when you'd need such a weird
construction.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140701/6998dc33/attachment.bin>


More information about the Strace-devel mailing list