Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [elf]

ELF stands for Executable and Linkable Format, a file format for files containing machine code.

0
votes
2answers
37 views

$LIB variable does not expand to anything in Ubuntu Server 18.10

I have the same exact problem as this question previously posted, where /etc/ld.so.preload does not intercept the right architecture. A little background: I have compiled a shared object (64-bit) that ...
2
votes
0answers
68 views

Are .text sections shared between loaded ELF executables?

If one program, for example grep, is curretly running, and a user executes another instance, do the two instances share the read-only .text sections between them to save memory? Would the sharing of ...
2
votes
0answers
32 views

Is there a standard for the Linux user-space memory map?

I'm contemplating a project where I would use a memory mapped file that is shared between multiple processes, and in order to be able to use pointer values in the mapped region in all those processes*,...
0
votes
0answers
11 views

Use objdump to show data as floating point

I have a ELF executable a.out that uses some floating point constants. After some investigation I found the address of these constants and then I do, $ objdump -s a.out | grep 4a9940 which gives me ...
2
votes
2answers
42 views

Different standards of ELF (SysV vs TIS) and Linux?

There are at least two standards of Executable and Linkable Format (ELF), one of them System V Application Binary Interface AMD64 Architecture Processor Supplement (With LP64 and ILP32 Programming ...
0
votes
1answer
51 views

Understanding the objcopy command in a book [closed]

I am reading a book and it's talking about ELF's. I understand it's a file format for executable files. There's a command that I executed on a VM and I'm having trouble understanding what it does. ...
1
vote
1answer
66 views

What happened to elfsign and elfverify?

In "Uninformed Research -- informative information for the uninformed." 2003 mentions a tool called elfsign and elfverify. This is a tool to checksum and sign an ELF binary. I can't find that tool in ...
1
vote
2answers
58 views

Why do some libc symbols have WEAK binding and others GLOBAL?

Why are different symbols in libc declared with different bindings, 1510 0x0003d200 0xf7d55200 WEAK FUNC 55 system 454 0x00067b40 0xf7d7fb40 WEAK FUNC 474 puts 147 0x000303d0 0xf7d483d0 ...
-3
votes
1answer
107 views

if a global or static C variable is not explicitly initialized, but implicitly initialized, is it in .data or .bss section? [closed]

Computer Systems: A Programmer's Perspective says about two sections in a ELF relocatable object file: .data Initialized global and static C variables. Local C variables are maintained at run ...
1
vote
1answer
33 views

Are the addresses inside a shared library file virtual addresses, or relocatable addresses?

Are the addresses inside a shared library file virtual addresses, or relocatable addresses? Does the answer depend on whether the shared library file was built with GCC’s -fPIC option? Originated ...
0
votes
2answers
122 views

What is the difference between Shared object file and Relocatable file?

https://linux-audit.com/elf-binaries-on-linux-understanding-and-analysis/ says The type field tells us what the purpose of the file is. There are a few common file types. CORE (value 4) DYN (...
0
votes
2answers
46 views

What ELF types do kernel itself and kernel modules have?

https://linux-audit.com/elf-binaries-on-linux-understanding-and-analysis/ says The type field tells us what the purpose of the file is. There are a few common file types. CORE (value 4) DYN (...
2
votes
1answer
115 views

What are difference between the ELF symbol visibility levels?

The NASM docs on "elf Extensions to the GLOBAL Directive" say, Optionally, you can control the ELF visibility of the symbol. Just add one of the visibility keywords: default, internal, hidden, or ...
1
vote
1answer
261 views

What is the difference between “LSB executable” (ET_EXEC) and “LSB shared object” (ET_DYN)?

With two files, one compiled and linked with gcc and the other manually with nasm and ld I get ELF 32-bit LSB shared object ... ELF 32-bit LSB executable ... What's the difference between these two ...
0
votes
0answers
24 views

Why is the bss section mapped to virtual address that doesn't match the corresponding value in the section header table?

I have compiled Python 3.4 from sources and when I run it, /proc/[pid]/maps shows the following for the bss section 56390aa95000-56390aab0000 rw-p 00000000 00:00 0 However, the section header table ...
1
vote
1answer
93 views

What is the number in readelf symbol table name?

I have a local static variable, something like this: void function(void) { static unsigned char myVariable = 0; ... I dump the symbol table using readelf as follows: readelf -s myprogram....
-1
votes
1answer
123 views

Determine kernel symbol offset from elf file

i have extracted the ELF file(stripped) from an bzImage using extract-vmlinux and extracted the __ksymtab and __ksymtab_strings sections afterwards. How can i calculate the offset of an arbitrary ...
0
votes
1answer
23 views

is uboot.bin location-independent?

ubootgenerate uboot.bin and uboot.elf. uboot.bin is used to burn to flash, at the start address of the CPU. uboot.elf is not very useful. NOTE: I think uboot.bin/uboot.elf are all location-...
0
votes
0answers
9 views

what is the relationship between the file types that uboot can boot?

Uboot has three boot cmd:bootelf/bootm/go.Corresponding to:32bitelf/uimage/bin filetype. Does these filetype have some relationship? Is there any means to convert them to each other? Now, I have a ...
1
vote
1answer
254 views

Remove .shstrtab with strip

I've noticed that strip removes ELF sections, such as .symtab and .strtab, but is there a way to force it to remove the .shstrtab section as well? I already tried the -R option but it didn't work. ...
2
votes
0answers
375 views

Extract a running ELF from a memory dump

Our teacher gave us as homework a memory dump from a VBox (Ubuntu 16.04.9) and said that the message we need to get is printed by an ELF currently running in the VM. This is my what I get after ...
0
votes
1answer
776 views

Symbol table in the .data section of ELF

I'm trying to understand how does symbol tables relate to the .data section in ELF. First some assumptions that I'm using as ground to start with. A symbol is a human readable (or "as written in ...
0
votes
1answer
37 views

Section .shstrtab not having flag for containing null-terminated strings

readelf -S a.out outputs: [Nr] Name Type Addr Off Size ES Flg Lk Inf Ar [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text ...
2
votes
1answer
314 views

Generate bootable ELF from bootloader, kernel, device tree, ramdisk

I'm new to Linux Kernel programming, and am pretty stuck with (what I think is) the last step in building my bootable image. For some background, we are trying to upload a complete OS image onto the ...
5
votes
1answer
592 views

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 ...
1
vote
2answers
77 views

Enforced memory protection granularity (x86-64)

I was experimenting with how Linux allocates and protects memory. For some of my experimentations I have created a small program in c: #include <stdio.h> int gv=10; int main(){ char *v=(...
1
vote
1answer
477 views

Extracting the size and origin of all symbols in an ELF

I am trying to estimate the code size of a binary's various components. I have access to the source code and resulting build directory containing all built object files. Of course, I want to include ...
21
votes
1answer
7k views

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), ...
1
vote
2answers
264 views

Can GDB decode core if it were piped?

I have huge core files, and hence set the core_pattern is set to gzip as they are written. Later if the backtrace is to be obtained, first gunzip has to be done (and it takes a very long time!) ...
2
votes
1answer
207 views

GNU linker producing useless spacing between sections in ELF file

My intent is to place the text section at a specific location in memory (0x00100000). SECTIONS { . = 0x00100000; .text : { *(.text*) } } Although the linker does do ...
1
vote
0answers
184 views

Updating 'Available Version' in .so

I'm trying to run the gitbook-editor on Arch Linux, and running in the openssl version issues. The error messages states: .... /usr/lib/libssl.so.1.0.0: version `OPENSSL_1.0.0' not found ... However ...
1
vote
1answer
244 views

Wine: Load old Access software - Invalid ELF header

I need to run old software(Based on Access 2.00) over Wine but i have many problems. Can someone give some pointers on this question: warn:module:load_builtin_dll failed to load .so lib for builtin ...
2
votes
0answers
213 views

Is it possible to combine two ELF binaries into one?

In Windows there is a utility called iexpress to which you can give two EXE files (File1.exe and File2.exe) and it will package them both into a single EXE (Result.exe). Executing Result.exe will ...
1
vote
1answer
11k views

How objdump disassemble elf binary

I have a quick question. I have generated a ELF binary from a c code using following code: gcc -o simple simple.c Then I do objdump for that ELF binary: objdump --disassemble-all simple I have ...
6
votes
2answers
549 views

Repack the filesystem image from vmlinux.bin (embedded initramfs) without rebuilding?

In How do I extract the filesystem image from vmlinux.bin? and https://wiki.gentoo.org/wiki/Custom_Initramfs#Salvaging methods are presented for getting and unpacking an embedded initramfs/initrd ...
1
vote
1answer
267 views

libandroid-shmem showing invalid ELF header in chrooted linux

I have chrooted Debian in android marshmallow (snapdragon 650 [64bit]). I installed iceweasel in chrooted debian. But it showed this error :: (firefox:16210): Gdk-WARNING **: shmget failed: error ...
3
votes
1answer
969 views

What's the difference between readelf and eu-readelf?

You get eu-readelf from: $ sudo apt-get install elfutils I was just wondering why you would use one over the other ?
2
votes
0answers
221 views

Meaning of MIPS flags in elf header

I was looking at the header of some elf files and noticed something odd: ELF Header: Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: ...
2
votes
1answer
145 views

.elf format internal inspection

I was reading ELF format specification, where was told all this stuff with elf-headers, program header, sections, segments and etc. All this is referenced as structs with all kind of fields and values....
1
vote
1answer
767 views

How to make $ORIGIN in RPATH not follow symlinks?

I have an executable app, which depends on a library libbar.so and loads it via RPATH with $ORIGIN like this: $ readelf -d app Dynamic section at offset 0xe08 contains 26 entries: Tag Type ...
6
votes
3answers
717 views

What harm would there be in running strip on all files?

I'm trying to decrease a Linux image running SuSE, and thought about running strip on all of the system's executables. Even though I may not re-gain much disk space this way, would there be any harm ...
2
votes
0answers
63 views

separate debug-info files in FreeBSD

In GNU/Linux, there are debug-link and build-id sections in ELF files which shows separate debug-info files name or CRC32 [https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html]. There ...
3
votes
3answers
56 views

Differentiate between ELFves and scripts quickly

How do I use file to differentiate between ELFves and scripts as quickly as possible? I don't need any further details, just ELF, script (/plaintext), or other/error.
1
vote
1answer
131 views

2 different libelf.h and libdwarf.h in FreeBSD?

In FreeBSD 10.3 there are 2 libelf.h, /usr/include/libelf.h and /usr/local/include/libelf/libelf.h. And they have different defines, such as enum Elf_Cmd. Also there are 2 libdwarf.h, /usr/include/...
5
votes
1answer
1k views

Why can't I execute Android x86 executables on Linux

I am trying to port Android apps to Linux (don't laugh :) and I have come across a problem. When trying to execute an Android executable (app_process) after adding the executable permission with ./...
2
votes
6answers
794 views

Searching for 32-bit ELF file

I wonder if there is any possibility to find files which are 32-bit ELF objects by using one single command in file system? I'm actually working in fedora 23 64 bit and can't locate any of those files ...
1
vote
1answer
362 views

Recompressing standalone vmlinux ELF file

I have a vmlinux file with no source code, header files or any other peripherals. What's the easiest way to convert it into a bootable zImage?
6
votes
1answer
2k views

Why doesn't `strip` remove section headers from ELF executables?

A minimal ELF executable only requires the ELF header and at least one program header in order to be functional. However, when I run strip on a short executable, it decides not to throw out the ...
31
votes
10answers
5k views

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, ...
1
vote
1answer
1k views

How to Cross Compile elfutils

My system (uname --all) Linux shyamdaramubtnb 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux My target ARM Cortex A7 I am in the process of cross ...