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
1 answer

how to see the assembly of libc functions in an elf

how can i see the assembly of standard c library functions in an elf? for example, i have a binary that i have the source code of this binary and i know that printf is called in main function. i want to see the assembly of printf function in this…
taranom
  • 153
  • 2
  • 12
0
votes
1 answer

How to identify an array defined in a shared library?

I'm dealing with an old proprietary shared library -- no source code. The binary contains lots of symbols (thousands), among them an array of character strings I need (several hundred strings). I know, it is there, because strings(1) lists them all…
Mikhail T.
  • 3,043
  • 3
  • 29
  • 46
0
votes
1 answer

Efficient way to parse DWARF

I try to build a debugger which allows me to set breakpoints at functions or codelines. The needed debug information should be extracted from the DWARF section from an elf file. I am able to extract these data. The project I want to debug has 50-100…
Feanor
  • 3
  • 3
0
votes
1 answer

Is there a standalone program to get same info from gdb info symbol

If I load a library in to gdb and do info symbol 0xB0153C I get something like function + offset Is there a way to get this same information without gdb? Like some readelf/objdump option? Thanks
TreeWater
  • 761
  • 6
  • 13
0
votes
0 answers

LFS: 9.1 - 6.10 readelf missing libdebuginfod.so.1

First time building LFS, I managed to get to the 6th chapter, but am stuck on the check for the second toolchain, after running gcc -dumpspecs | sed -e 's@/tools@@g' \ -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ -e…
soz
  • 304
  • 2
  • 11
0
votes
1 answer

Why sum of symbol size much less than ".text" section size?

I'm debugging a dynamic shared library in linux, the name of the library is libMNN.so. Here is the size of all sections of libMNN.so got by size -A ./libMNN.so : section size addr .note.gnu.build-id 36 512 .hash …
expoter
  • 1,622
  • 17
  • 34
0
votes
1 answer

Get frames from a shared library (.SO) with STABS

I have an Android SO library with STABS debug info, as opposed to DWARF. I'd like to get the call frame information from it, similar to what ...-readelf --debug-dump=frames-interp outputs. With most NDK built libraries, readelf does the trick, but…
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
0
votes
1 answer

ELFIO is creating all-zero ELF sections, regardless of set data. How do I get the data into the .text section?

I'm trying to create an ELF object using ELFIO. Solution: the line section_text->set_flags(SHT_PROGBITS); should be section_text->set_type(SHT_PROGBITS); The resulting object is wrong (described below) so: How do I create an elf section with the…
NeonMan
  • 623
  • 10
  • 24
0
votes
1 answer

Integer within C binary: viewing it using readelf, objdump or similar

I have the following C source file, hello.c, compiled on linux via g++ -o hello hello.c: #include const char* p = "Hello world"; const long nn = 0xDEADBEEF; int main() { printf("%s %ld", p, nn); return -1; } (Yes I know…
Wad
  • 1,454
  • 1
  • 16
  • 33
0
votes
1 answer

Segmentation Fault after injecting section

I am currently following a book by Dennis Andriesse about binary disassembling and instrumentation. In a later chapter, we have written an injector for ELF type files. The injector places a code section at location 0x80000 [+offset %16], overwriting…
clockw0rk
  • 576
  • 5
  • 26
0
votes
1 answer

RISC-V: Size of code size in an object file which is not linked

I have a .i file which I have compiled but not linked using the SiFive risc-v compiler as follows: ../riscv64-unknown-elf-gcc-8.2.0-2019.05.3-x86_64-linux-ubuntu14/bin/riscv64-unknown-elf-gcc clock.i However when I do a readelf -S on the compiled…
Har
  • 3,727
  • 10
  • 41
  • 75
0
votes
1 answer

Find functions names in .init_array section in unstripped library

Is it possible to find out all instances of static initialization in a elf dynamic library. I can dump the array of function pointers in .init_array section via objdump command like this. objdump -s -j .init_array Is there a way to…
Arpit Aggarwal
  • 841
  • 8
  • 18
0
votes
0 answers

How to determine Ram/Rom usage of elf using binutils?

I would like to extract the Ram and Rom usage of each module by the help of binutils tools. I have a couple of objects (relocatable elf files) and a final executable (elf) to determine those data from. I am writing a reusable (among different…
lukas
  • 1
  • 3
0
votes
1 answer

Can I get symbol name by "GOT address"?

Now I'm developing program like readelf using pyelftools libraries. I want to print the table like below. In here, Offset field is stderr@GOT address. jiwon@jiwon$ readelf -a --wide libstdbuf.so ... Relocation section '.rel.dyn' at offset…
Jiwon
  • 1,074
  • 1
  • 11
  • 27
0
votes
1 answer

How to determine what is being relocated using readelf

From the snippet below, I can see that the relocation entry is to be applied at offset 0x000000201018 of some section, but how can I determine what section? Also all of my sections are smaller than this offset. What are the implications of…
Hassan
  • 870
  • 13
  • 25