WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Failed to execute my binary  (Read 3425 times)

Offline clauder

  • Newbie
  • *
  • Posts: 11
Failed to execute my binary
« on: August 28, 2020, 05:10:24 PM »
I am trying to move from Core 10.1 to CorePure64-10.1 (BTW, what is the Pure in CorePure64? I was expecting a Core64 but that does not exists; it is simply trying to say that there is no support for 32 bits binaries?)

I cross compile, using crosstool-ng where I have both 64 and 32 bits tool chains.
  Using the 32 bits tool chain and Core 10.1 all is fine.
  Using the 64 bits tool chain and CorePure64-10.1 does not work. I get a "not found" message when I try to run my binary - I suspect something related to libraries
  Using the 64 bits tool chain and running my binary on Ubuntu18.04, all is fine

ldd (on Ubuntu) on my binary shows the expected result. On CorePure64, ldd says that my binary is statically linked, which is wrong. The ldd output when running it on Ubuntu for my binary is:
Code: [Select]
linux-vdso.so.1 (0x00007fffeef7f000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fede96e2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fede94de000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fede9140000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fede8f21000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fede8b30000)
/lib64/ld-linux-x86-64.so.2 (0x00007fede98ea000)

objdump for my binary says:  file format elf64-x86-64

    [EDIT]: Added code tags.  Rich
« Last Edit: August 28, 2020, 05:39:24 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Failed to execute my binary
« Reply #1 on: August 28, 2020, 05:38:42 PM »
Hi clauder
...  (BTW, what is the Pure in CorePure64? ...
If you are running Core (32 bit kernel, 32 bit apps), you can only run 32 bit programs.
If you are running Core64 (64 bit kernel, 32 bit apps), you can only run 32 bit programs.
If you are running Corepure64 (64 bit kernel, 64 bit apps), you can only run 64 bit programs.
Tinycore does not support mixed 32/64 bit libraries (and extensions).

Offline clauder

  • Newbie
  • *
  • Posts: 11
Re: Failed to execute my binary
« Reply #2 on: August 28, 2020, 06:07:06 PM »
I can not find Core64. But in any case, I want to run 64 bits app so CorePure64 is perfect. If I could just run my 64 bits app...

Offline clauder

  • Newbie
  • *
  • Posts: 11
Re: Failed to execute my binary
« Reply #3 on: August 28, 2020, 06:28:30 PM »
I found my problem.

I guess my 64 bits tool chain is configured for a 64/32 bits target since it needs /lib64 to exists...... I simply added a symlink to get /lib64 to point /lib and it works now.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Failed to execute my binary
« Reply #4 on: August 28, 2020, 08:46:22 PM »
Hi clauder
I can not find Core64. ...
It gets made like this:
Code: [Select]
cat rootfs.gz modules64.gz > core64.gzThat creates a new  initrd  that combines a 32 bit root file system with 64 bit kernel modules. This will allow you to boot a 64 bit
kernel while running 32 bit extensions. Any extensions requiring kernel modules will need the 64 bit versions.

The files can be found here:
http://tinycorelinux.net/10.x/x86/release/distribution_files/

Offline clauder

  • Newbie
  • *
  • Posts: 11
Re: Failed to execute my binary
« Reply #5 on: August 29, 2020, 06:12:57 PM »
Ah, makes sense.

This should be documented somewhere. The wiki would be a good place, it is was working....