ELF stands for Executable and Linkable Format, a file format for files containing machine code.
Questions tagged [elf]
129 questions
67
votes
9 answers
Can we get compiler information from an elf binary?
Is there some chance to know how a binary was built, under Linux? (and or other Unix)
Compiler, version, time, flags etc...
I looked at readelf and couldn't find much, but there might be other ways at analyzing the binary code/section…
elmarco
- 1,434
- 1
- 14
- 13
36
votes
10 answers
Why are programs not distributed in compiled format?
But they give instructions like
cd downloaded_program
./configure
make install
This creates the ELF that is needed, and probably some .so files.
Why not put those inside a zip file for download, like with windows apps? Is there any reason why they…
kitty
- 417
- 4
- 3
33
votes
2 answers
Oldest binary working on Linux?
In a discussion on backwards-compatibility in Linux kernel and GUI ABIs, Alan Cox notes that "my 3.6rc kernel will still run a Rogue binary built in 1992. X is back compatible to apps far older than Linux."
So just how backwards-compatible are the…
nealmcb
- 766
- 9
- 16
32
votes
2 answers
What is ELF Magic?
I've seen discussion before about ELF magic, most recently the comments in this Security stack exchange question. I've seen it mentioned before, and I've seen it in my own boot logs.. But I'm not sure what it is.
The man page on elf is a bit over my…
Mitch
- 1,188
- 3
- 13
- 24
31
votes
1 answer
What does "LSB" mean when referring to executable files in the output of /bin/file?
I have found the term "LSB executable" or "LSB shared object" in the output of the file command in Linux. For example:
$ file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter…
yoyo_fun
- 855
- 3
- 9
- 14
19
votes
1 answer
Why does the file command say that ELF binaries are for Linux 2.6.9?
Whenever I run file on an ELF binary I get this output:
[jonescb@localhost ~]$ file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9,
not…
jonescb
- 1,908
- 1
- 16
- 21
19
votes
2 answers
Determine if a specific process is 32- or 64-Bit
Given a 2.6.x or newer Linux kernel and existing userland that is capable of running both ELF32 and ELF64 binaries (i.e. well past How do I know that my CPU supports 64bit operating systems under Linux?) how can I determine if a given process (by…
Flexo
- 375
- 1
- 2
- 12
15
votes
1 answer
Linker script in .so file? (libc.so) Is that right?
I am currently trying to get python to run on my NAS which is a Zyxel NSA325.
I did manage to get python 2.7 and pip running and I was able to successfully install the watchdog module with pip. I followed these instructions to get python and pip…
Forivin
- 779
- 5
- 18
- 37
13
votes
1 answer
Linux, GNU GCC, ld, version scripts and the ELF binary format -- How does it work?
I'm trying to learn more about library versioning in Linux and how to put it all to work. Here's the context:
-- I have two versions of a dynamic library which expose the same set of interfaces, say libsome1.so and libsome2.so.
-- An application is…
themoondothshine
- 233
- 2
- 6
12
votes
2 answers
Which parts of an ELF executable get loaded into memory, and where?
What I already know:
An ELF executable has a number of sections, obviously the .text and .data sections get loaded into memory as these are the main parts of the program. But for a program to work, it needs more info, especially when linked…
Dutchy
- 133
- 1
- 9
12
votes
9 answers
How to find executable filetypes?
I want to find file types that are executable from the kernel's point of view. As far as I know all the executable files on Linux are ELF files. Thus I tried the following:
find * | file | grep ELF
However that doesn't work; does anybody have other…
JohnnyFromBF
- 3,476
- 10
- 32
- 42
12
votes
1 answer
When can I edit strings in an executable binary?
I have an executable binary; let's call it a.out. I can see the binary contains strings
$ strings a.out
...
/usr/share/foo
....
I need to change the string /usr/share/foo to /usr/share/bar. Can I just replace the string with sed?:
sed -i…
Martin Vegter
- 69
- 66
- 195
- 326
11
votes
3 answers
Detect if an ELF binary was built with gprof instrumentation?
Is it possible to check if given program was compiled with GNU gprof instrumentation, i.e. with '-pg' flag passed to both compiler and linker, without running it to check if it would generate a gmon.out file?
Jakub Narębski
- 1,228
- 2
- 17
- 30
10
votes
1 answer
What does `*` mean using hexdump -C?
I've been doing an exersice in attempt to understanding some of what's going on under the hood of a program. I wrote a small C program, and compiled it on i386 Linux (Ubuntu 12.04) using gcc. I then did a hexdump -C on the output to text file. I…
Chad Harrison
- 1,613
- 3
- 18
- 21
10
votes
1 answer
Can I skip syscalls made by the dynamic loader in strace?
When I use strace to examine a program, I often have a hard time finding where the syscalls from the dynamic loader end and the syscalls from the program begin.
The output from strace ./hello where hello a simple hello world C program is 36 lines.…
jrpear
- 327
- 1
- 10