Questions tagged [readelf]

readelf displays information about ELF object files

readelf displays information about Executable and Linkable Format object files. It performs a similar function to objdump but it goes into more detail and it exists independently of the BFD library, so if there is a bug in BFD then readelf will not be affected.

On Linux, two widely available implementations exist:

138 questions
0
votes
0 answers

Analyzing ELF memory layout

I was analyzing an ELF Executable with readelf and getting the following Program and header. |Type | Offset | VirtAddr | PhysAddr | FileSiz | MemSiz | Flg | Align | size | start addr | end addr | |PHDR | 0x000034 | 0x08048034…
Wicky
  • 44
  • 5
0
votes
1 answer

Nearly duplicate symbols from readelf at same address

I am using readelf to figure out why a binary is so large, but I am confused about the output. Or my binary is linked very wrongly. Right now the binary is approximately 380MB, and if I do this: readelf -W -s binary | awk 'NR > 3 { sum += $3 } END…
0
votes
1 answer

How do I extract all the fields from a Section Header for an elf file?

So I was able to get the sh_name using the Elf tutorial here: http://wiki.osdev.org/ELF_Tutorial and this question: getting the sh_name member in a section header elf file, but when using the same method to get the rest of the fields in the section…
srujzs
  • 340
  • 3
  • 14
0
votes
1 answer

objdump --dwarf of assembly code does not list function

I wrote simple x86 assembly routine: $ cat asm.s .global foo .section .text foo: nop ret And compiled it with $ gcc -c -g asm.s -o asm.o But when I do objdump --dwarf asm.o, it does not display any info about function foo. Looks like,…
Ravi
  • 1,574
  • 2
  • 16
  • 28
0
votes
1 answer

How does gdb backtrace knows which library each function is taken from?

I've written a simple program that all it does is call a function called meller1, which calls to meller2, and so on until some function calls free and crashes. When running gdb backtrace on this program with the coredump file, I receive: gdb bt My…
Adiemus
  • 11
  • 2
0
votes
1 answer

Incorrect function size inside ARM ELF object

readelf output of the object file: Symbol table '.symtab' contains 15 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS fp16.c …
Koten
  • 599
  • 2
  • 5
  • 13
0
votes
1 answer

How to use gnu utils to select one line from these three lines?

So basically I want to use this command to get the .plt section info. readelf -S ELF_Binary | awk '/plt/ {print $2,$4,$5,$6} ' and the output is like this: .rel.plt 08048b20 000b20 0001f0 .plt 08048d40 000d40 0003f0 .got.plt 08050ff4 007ff4…
lllllllllllll
  • 8,519
  • 9
  • 45
  • 80
0
votes
1 answer

windows how to show memory segment of a process?

We have tools like objdump, readelf, and dumbin to show executable file contents. But when an executable file is loaded into memory (a process is created), the segments in memory is usually different from the segments in the executable file. For…
Zachary
  • 1,633
  • 2
  • 22
  • 34
0
votes
0 answers

Extract informations from ELF file

I use the Windows XP Operating System. I cann't understand the logic by which readelf displays structures and unions. Is there any method to extract all structures and unions from the ELF file using readelf ?
physics
  • 161
  • 9
0
votes
2 answers

generate list of c++ methods called from an executable

Is there a way to generate a list of C++ methods being called for an executable? I have a dynamic library and would like to see how many of the methods are being called from the executable. I can see that the C++ methods are being exported through…
David J
  • 1
  • 1
0
votes
1 answer

objdump won't show my ELF sections

I have a tool emitting an ELF, which as far as I can tell is compliant to the spec. Readelf output looks fine, but objdump refuses to disassemble anything. I have simplified the input to a single global var, and "int main(void) { return 0;}" to aid…
David Mirabito
  • 455
  • 5
  • 13
0
votes
2 answers

linux ELF section and header access permission

In my understanding, ELF header is for program execution view. section is for linker's view. but linux command 'readelf' shows that there are memory access permission flag for each section (AWX) and each header (RWE). the book say's more than one of…
daehee
  • 5,047
  • 7
  • 44
  • 70
0
votes
1 answer

objdump/readelf get variables information

I need to get the information about global variables from a compiled c program. I asked a similar question in here. The problem that I have now is that the program where I am trying to extract the variables info is very big and it takes 4 seconds…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
0
votes
1 answer

Elf to memory image for simulation

I am writing a C++ simulation model of Sparc V8. Memory is modelled simply as an array. I need to read an elf-executable generated by a cross compiler and use it to initialise the memory. I am planning to do it as follows. sparc-elf-readelf…
Neha Karanjkar
  • 3,390
  • 2
  • 29
  • 48
-1
votes
1 answer

How does an ELF file determine the offset values of each segment?

This is the command I've done: readelf -l helloworld And this is the output: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align PHDR …
BadUsernameIdea
  • 182
  • 1
  • 12
1 2 3
9
10