I have a project that compiled with dynamic linker flag '-pie' and I used the .rela.dyn section for creating ASLR (address space layout randomization).
Everything is working fine, but when I want to run objdump on the .out file I have a problem.
Because of the ASLR - the code start every time on randomize address at some offset from the static start address that exist at the lds file (this implementation is similar to Linux kernel KASLR).
My log contains a randomize addresses but the objdump is on .out file that start from the static address from the lds file.
I tried to use the option "--adjust-vma=offset" at objdump with the current offset from the static start address, but then I have two problems:
- -S option doesn't work
- --start-address option doesn't working
I can convert my log, replace all the randomize addresses to static addresses (subtract the randomize offset), but I searching for simplest solution.
Any idea how to use all this objdump options together? or other quick and simple using of objdump? What is the way to debug Linux kernel with objdump while KASLR feature is enable?