Cannot execute binary file error when running bibtex2html - linux

I'm working on a project for a friend on a machine I'm not familiar with and I've run into some errors.
I'm running a program called bibtex2html, which is used to generate an HTML reference page. When I run the program, it gives me a "Cannot execute binary file" error.
From my preliminary research, it seems there are a number of causes to this problem, and I'm not really sure to begin.
What I've done so far:
uname -a ->
Linux baseline 2.6.38-15-generic-pae #60-Ubuntu SMP Tue May 22 11:48:17 UTC 2012 i686 i686 i386 GNU/Linux
file ~/bibtex2html/bibtex2html -> ~/bibtex2html/bibtex2html: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

You did all the research correctly, now you just need to interpret it. It's a 64-bit executable (x86-64), and you're on a 32-bit kernel (i686). You'll need to find or compile a 32-bit version of bibtex2html.

Related

Eclipse cross compiling in Ubuntu 16.04

My end goal is to write a C based application to run on a 32-bit linux ARM board as an embedded system. I am running a virtual 64-bit Ubuntu OS with Eclipse Neon and I am struggling with getting a useable executable file.
I have setup the cross compiler and I have made sure to build in 32-bit.
To check the file type and get more information on it I have used the command
> file hello.elf
I got sample hello world executable that does work and the output of the file command is
hello.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armf.so.3, for GNU/LINUX 2.6.32, BuildID
This program runs just fine, the output of the file command for my program (be-brave) is as follows, side note it's a simple hello world, I called it be-brave for motivation
be-brave.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/LINUX 3.2.0, BuildID
My guess is that the issue is the GNU/LINUX differemce meaning my cross compiler is not set right but I don't know for sure and even if that is the case I don't know how to fix it.
Any and all pointers/suggestions are greatly appreciated
I was able to find a workaround using the command line following this tutorial
Installing ARM cross compiler
I would still like to be able to use Eclipse so I will leave this question open in case anyone can help with that. I have a new issue, I am going to edit the original question to ask that

Symbol Look up error: undefined symbol: _ZNSt8messagesIwE2idE

I have an application build using gcc 4.9.2. I have statically linked libstdc++ and libgcc for compatibility issues. The program runs fine in many linux distributions I tested. But in one system I find the following error
Symbol Look up error: undefined symbol: _ZNSt8messagesIwE2idE
I've run c++filt on the errror which gives the result
echo _ZNSt8messagesIwE2idE | c++filt
std::messages<wchar_t>::id
Running file command gives the following result
file app
app: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), for GNU/Linux 2.6.32, dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
Running ldd gives,
ldd app
not a dynamic executable
But it is a dynamic executable. The same file runs on other similar machines.
uname gives
uname -a
Linux el-rhel5-1 2.6.18-164.el5PAE #1 SMP Tue Aug 18 15:59:11 EDT 2009 i686 i686 i386 GNU/Linux
why am I getting "not a dynamic executable" message even though it is executable?
What does this error mean and what are the ways to fix this?
Thanks.
why am I getting "not a dynamic executable" message even though it is executable?
ldd also gives that message if it doesn't recognise the file format, or some other error occurs.
Are you sure the file is exactly the same as on the other machines? You could use md5sum to verify it's the same on every machine and hasn't got corrupted on the machine where ldd can't read it and it gives the symbol lookup error.

"No such file or directory" when running app on linux arm target

I have a development kit ( Altera Cyclon V, Cortex A9) and I'm trying to run a simple app on it.
I'm using cygwin for cross compiling my code for ARM Linux (using soureforge toolchain for Linux ).
Steps :
build within cygwin : arm-linux-gcc dd.c -s -mcpu=cortex-a9 -s -o ddb
copy ddb to target and chmod a+x
running it gives me "./ddb: No such file or directory" .
probably a mismatch between lib\tools but I'm new to Linux ( coming from QNX ).
Target is running :
root#socfpga:~/altera# cat /proc/version
Linux version 3.9.0 (jdasilva#sj-interactive3) (gcc version 4.7.3 20121106 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2012.1
1-20121123 - Linaro GCC 2012.11) ) #1 SMP Fri Sep 27 22:55:43 PDT 2013
File data of my app :
ddb: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared
libs), for GNU/Linux 2.6.33, stripped
File data of a sample hello_world that runs on target :
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (use
s shared libs), for GNU/Linux 2.6.31, BuildID[sha1]=0x2e8fbebd0bdab5897c0c65fb6b
563f3c34a16eb1, stripped
I can see that different DLL are being used ( 2.6.31 vs 2.6.33 ).
How can I solve this?
I've had that problem before when I tried to copy ARM binaries to an ARM android device.
You solved it, but either way, this is what I found out. The problem was the shared libraries. It is trying to load a library that doesn't exist on the target. The "file not found" error is very misleading.
Related question and answers:
"No such file or directory" but it exists
could be 64<>32bit problem.
See this

Looking for compiler for 32-bit LSB MIPS architecture

I want to copile a simple c program ("Hello world") for my Xtreamer prodigy. which runs a basic linux kernel:
/host # uname -a
Linux Prodigy 2.6.34-VENUS #30 PREEMPT Tue Feb 28 13:48:27 CST 2012 mips GNU/Linux
(it using chipset Realtek 1186)
I saw one executable file on the streamer and i "filed" it on linux and i got:
sh-4.1# file DvdPlayer
DvdPlayer: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, stripped
On my computer I run linux centos. what compiler do I need to use and when can I get it?
Thanks!
What you need is a cross toolchain - gcc has a architecture that enables it to have different code generation backends, mainly to be able to compile for other architectures than the one you're developing on.
Lots of precompiled cross toolchains exist, an overview of ready to use toolchains for MIPS can be found here.
On the other hand, creating your own cross tool chain, finetuned to your needs, isn't that hard either, it's just quite a bit of work. The canonical reference on how to generate a cross toolchain is Dan Kegel's page.

Is this a problem with my distro or the application?

I hope someone can help me with this :)
I am running Arch Linux and am trying to get a game to work (Penumbra Overture). I have downloaded the executable, checked the md5 and they match, installed it in a directory. However when I try to execute the file an error appears saying:
bash: ./penumbra.bin: No such file or directory
It does exist, I am in the right folder and it is set as executable:
-rwxr-xr-x 1 kumagoro users 6814000 Apr 15 2010 penumbra.bin
file penumbra.bin says:
penumbra.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
ldd penumbra.bin says:
not a dynamic executable
So, is this a problem with my distro or the application?
Thanks
You are missing the interpreter for the binary. Check with
readelf -a penumbra.bin | grep -i program.interp
what it wants.

Resources