objdump

virtual and physical addresses of sections in elf files

送分小仙女□ 提交于 2019-11-27 21:45:17
问题 How does objdump compute the physical address (LMA) of elf sections? As far as I can tell, elf section headers only contain the virtual address (VMA) of sections [1]. Usually, VMA and LMA are the same. But for initialized data sections (.data), the VMA is the RAM location of the variables and LMA is the ROM location where the initial values are located. Crt0 is responsible for copying the initial values into RAM before main() is called. For example: $ objdump -h my.elf Sections: Idx Name Size

Disassembling A Flat Binary File Using objdump

会有一股神秘感。 提交于 2019-11-27 19:20:58
Can I disassemble a flat binary file using objdump? I'm familiar with disassembling a structured binary executable such as an ELF file using: objdump -d file.elf But if I have a flat binary file that I know is supposed to be loaded at, e.g., address 0xabcd1000, can I ask objdump to disassemble it? I tried supplying options such as '--start-address=0xabcd1000' but objdump just states that it doesn't recognize the format. I have other ideas about how to disassemble the file but I wanted to know if objdump could provide a simple solution. I found the solution to my own question on a different

where/how does Apples GCC store DWARF inside an executable

和自甴很熟 提交于 2019-11-27 19:11:19
Where/how does Apples GCC store DWARF inside an executable? I compiled a binary via gcc -gdwarf-2 (Apples GCC). However, neither objdump -g nor objdump -h does show me any debug information. Also libbfd does not find any debug information. (I asked on the binutils-mailinglist about it here .) I am able however to extract the debugging information via dsymutil (into a dSYM). libbfd is also able to read those debug info then. Jason Molenda On Mac OS X there was a decision to have the linker ( ld ) not process all of the debug information when you link your program. The debug information is often

Tool to analyze size of ELF sections and symbol

佐手、 提交于 2019-11-27 17:53:00
I need a way to analyze output file of my GCC compiler for ARM. I am compiling for bare metal and I am quite concerned with size. I can use arm-none-eabi-objdump provided by the cross-compiler but parsing the output is not something I would be eager to do if there exists a tool for this task. Do you know of such a tool existing? My search turned out no results. One more thing, every function in my own code is in its own section. You can use nm and size to get the size of functions and ELF sections. To get the size of the functions (and objects with static storage duration): $ nm --print-size -

How to disassemble one single function using objdump?

一个人想着一个人 提交于 2019-11-27 10:54:46
I've got a binary installed on my system, and would like to look at the disassembly of a given function. Preferrably using objdump , but other solutions would be acceptable as well. From this questions I've learned that I might be able to disassemble part of the code if I only know the boundary addresses. From this answer I've learned how to turn my split debug symbols back into a single file. But even operating on that single file, and even disassembling all the code (i.e. without start or stop address, but plain -d parameter to objdump ), I still don't see that symbol anywhere. Which makes

How can I examine contents of a data section of an ELF file on Linux?

雨燕双飞 提交于 2019-11-27 10:33:18
I've been using objdump to look at assembly code in Linux ELF binaries. Sometimes there is an indirect jump through a jump table that is stored in the rodata (read-only data) section. How to get objdump or any other tool to show me the contents of this data section? I could execute the program and examine the relevant addresses in the debugger, but I don't want to do that because it has to be done interactively. The ideal answer will identify a tool that will not only show me the contents but will let me control the display format, much as od does. hobbs objdump -s -j .rodata exefile gives a

How to use/install GNU binutils (objdump)

孤者浪人 提交于 2019-11-27 03:51:16
问题 I need to use the objdump and readelf commands in my application that runs on windows. I know I can install cygwin in order to use them. The reason why I don't want to use cygwin is because I want to make it essay to deploy. Plus I don't know how to make a silent install of cygwin. As a result I believe that what I need is GNU Utilities For Win32 as the link states those libraries are serverless. "executables do only depend on the Microsoft C-runtime (msvcrt.dll) and not an emulation layer

What is register %eiz?

不打扰是莪最后的温柔 提交于 2019-11-27 00:50:24
问题 In the following assembly code that I dumped out using objdump : lea 0x0(%esi,%eiz,1),%esi What is register %eiz ? What does the preceding code mean? 回答1: See Why Does GCC LEA EIZ?: Apparently %eiz is a pseudo-register that just evaluates to zero at all times (like r0 on MIPS). ... I eventually found a mailing list post by binutils guru Ian Lance Taylor that reveals the answer. Sometimes GCC inserts NOP instructions into the code stream to ensure proper alignment and stuff like that. The NOP

How do GNU assembler x86 instruction suffixes like “.s” in “mov.s” work?

这一生的挚爱 提交于 2019-11-26 22:04:41
问题 GNU assembler appears to have some means of controlling the alternative forms of the opcode being emitted for some instructions. E.g. .intel_syntax noprefix mov eax, ecx mov.s eax, ecx Processing the above code with as test.s -o test.o && objdump -d test.o -M intel gives the following disassembly: 0: 89 c8 mov eax,ecx 2: 8b c1 mov eax,ecx We can see that .s suffix appears to switch 89 opcode to the 8b version (and appropriately change the ModRM byte). How does this syntax work in GAS? I can't

where/how does Apples GCC store DWARF inside an executable

别等时光非礼了梦想. 提交于 2019-11-26 19:38:43
问题 Where/how does Apples GCC store DWARF inside an executable? I compiled a binary via gcc -gdwarf-2 (Apples GCC). However, neither objdump -g nor objdump -h does show me any debug information. Also libbfd does not find any debug information. (I asked on the binutils-mailinglist about it here.) I am able however to extract the debugging information via dsymutil (into a dSYM). libbfd is also able to read those debug info then. 回答1: On Mac OS X there was a decision to have the linker ( ld ) not