I’m trying to manipulate ARM elf binaries on linux using the libelf library without success. Even a minimal test-case corrupts my binaries, and I don’t know why. Here is my minimal test-code which reads an elf-file and then simply writes it back: If I run this code on a ELF 64-bit x86-64 executable I get a bit-exact copy of the
Tag: elf
How to limit the address space of 32bit application on 64bit Linux to 3GB?
Is it possible to make 64bit Linux loader to limit the address space of the loaded 32bit program to some upper limit? Or to set some holes in the address space that to not be allocated by the kernel? I mean for specific executable, not globally for all processes, neither through kernel configuration. Some code or ELF executable flags are
How to not emit local symbols in NASM so that GDB disas won’t stop at them?
I’m trying to write some assembly programs using nasm on linux. Everything is good, but I make heavy use of local symbols (.loop, .else, etc.), which is a pain when debugging, because these symbols are emitted to the symbol table, e.g.: will produce a disassembly that looks like: which is a bit annoying just because gdb will think these are
How to get a pointer to a specific executable file’s section of a program from within itself? (Maybe with libelf)
I’m on a Linux environment and I need to make a program that retrieves some data that is placed in one of the sections of its executable file. So, how to get a pointer to a section of a program (by its name) from within itself? I know it’s possible to use elf_getdata() passing the index of the section as
Mach-O’s two-level namespace symbol resolution in ELF/linux
Anyone know of an equivalent to Mach-O’s two-level namespace symbol resolution in ELF/linux? I want code that links to lib+sym, not sym. I’m trying to do what could best be described as precompilation of what normally would be a JIT compilation. I’d like to get a compile time binding of symbols, that normally would be done by a dlopen/dlsym. However,
How can I find the size of a ELF file/image with Header information?
I need to find the size of an elf image for some computation. I have tried with the readelf utility on linux which gives the informations about the headers and section. I need to have the exact file size of the elf(on the whole). How do I find the size of the ELF from the header information or Is there