144 questions
2
votes
1
answer
37
views
How to interpret the value of an ABS symbol in a ELF file?
I was looking to the symbols in the libc.a file and I noticed there some "ABS" symbols.
For example, there is the "_nl_current_LC_COLLATE_used" symbol.
Here is the output of ...
0
votes
0
answers
48
views
Why DW_AT_language is C11 for -std=c17 (and higher)?
For -std=c17 (and higher) DW_AT_language is C11:
$ echo "int x;" | gcc -c -xc - -fPIC -o x.o -g -std=c17
$ gcc -shared -o x.so x.o
$ readelf x.so -w | grep -P '(DW_AT_language\s*:|DWARF ...
0
votes
1
answer
78
views
How to parse from a eabi .out file?
I have a .out eabi binary file and I'm trying to parse out all the symbol names, addresses, types, and byte sizes.
I found some information about this using readelf, but its not super clear to me ...
0
votes
1
answer
100
views
readelf -R (--relocated-dump) option
Can anyone explain how the contents of a section are relocated using the -R option for readelf?
I would like to see an example of this so I can understand how it works.
When I build an executable ...
1
vote
1
answer
329
views
`p_offset` in ELF binary
I'm trying to learn the ELF format and am implementing an ELF parser. So far, I've implemented the ELF header parser, and I'm working on parsing segments, especially the .text segment. I'm stuck here ...
2
votes
1
answer
475
views
how to decompose elf file size into different size of sections or symbols?
I want to know each symbol's size in elf executable or dynamic library and I assume the total symble size and other stuff's size can add up to the file size.
From size command I can see all section ...
0
votes
1
answer
826
views
fix elf segment address on an objcopy output binary
I'm trying to inject some compiled code into an elf executable. The strategy is to write some bytes at the end of the 'code' segment. The reason why I chose that segment is because I need my payload ...
2
votes
2
answers
438
views
Symbol table from readelf shows static variable size 0
I'm looking into the possibilities to get a list of all global and static variables that are in my application, with their name, size, and address.
My toolchain (TI CCS 12.3) produces an ELF output ...
1
vote
0
answers
211
views
Simple struct increasing size of C++ Android binary
Why does adding the below struct to my public header cause my android binary size (libMyLibrary.so) to increase by 4KB?
#define EXPORT __attribute__((visibility("default")))
struct EXPORT ...
1
vote
0
answers
134
views
Addresses of pointers in C
I made this simple C program and compiled it without ASLR
#include <stdio.h>
#include <stdlib.h>
int a = 10;
int b = 20;
int main(int argc, char *argv[])
{
printf("%lx\n",&...
2
votes
1
answer
263
views
Objdump to tell if binary was built on Redhat or Suse
Is there a switch in objdump or readelf which can tell if an ELF binary was built on Redhat or SUSE? I only have binary and no source code.
Is there any other way (like strings command or nm) that ...
1
vote
1
answer
205
views
Duplicate section VMAs of 0 in default linker script
arm-none-eabi-gcc's default linker script defines several sections with VMA of 0. Most of these contain debug information:
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
....
4
votes
2
answers
1k
views
What does "readelf: Warning: Corrupt offset in range entry N" mean?
I am running readelf -w on my (C++) executable to examine some debug sections and it prints the following warnings a couple of times:
$ readelf -w a.out
...
readelf: Warning: Corrupt offset (...
0
votes
1
answer
100
views
Different section header offsets in otherwise identical object files
So I have two different ELF files, one that came precompiled and the other I compiled from source. The output from readelf is:
Precompiled File (File1):
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 ...
1
vote
1
answer
410
views
How can a LOAD segment have an offset of 0?
Look at this readelf of an ELF file, the first LOAD segment has offset 0.
How is that even possible? Isn't the ELF header at offset 0?
readelf -l