objdump

How do I find out which functions of a shared object are used by a program or an other library?

给你一囗甜甜゛ 提交于 2019-12-20 08:40:05
问题 How do I find out which functions of a shared object are used by a program or an other library? In this specific case, I would like to see which functions in /lib/libgcc1_s.so.1 are used by an other dynamic library. Since they are dynamically linked, objdump -d doesn't resolve the function call addresses. Is there a way short of running the program in a debugger or relinking statically? Thanks, Luca Edit: nm and readelf won't do, I don't need to see which symbols are present in a shared

How to know which library a specific function is defined in?

左心房为你撑大大i 提交于 2019-12-18 12:29:25
问题 [root@xxx memcached-1.4.5]# objdump -R memcached-debug |grep freeaddrinfo 0000000000629e10 R_X86_64_JUMP_SLOT freeaddrinfo ... (gdb) disas freeaddrinfo Dump of assembler code for function freeaddrinfo: 0x00000037aa4baf10 <freeaddrinfo+0>: push %rbp 0x00000037aa4baf11 <freeaddrinfo+1>: push %rbx 0x00000037aa4baf12 <freeaddrinfo+2>: mov %rdi,%rbx So I know freeaddrinfo is a dynamically linked function,but how to know which .so it's defined in? 回答1: See this answer. The info symbol freeadrinfo

How can objdump emit intel syntax

放肆的年华 提交于 2019-12-18 10:32:24
问题 How can I tell objdump to emit assembly in Intel Syntax rather than the default AT&T syntax? 回答1: What you're looking for is -M intel . Use it as follows. objdump -M intel -d program_name 回答2: If you want Intel mnemonic codes as well (instead of AT&T mnemonic codes), you can use: objdump -M intel intel-mnemonic -D <program's-object-file> 来源: https://stackoverflow.com/questions/10362630/how-can-objdump-emit-intel-syntax

How can objdump emit intel syntax

一曲冷凌霜 提交于 2019-12-18 10:32:03
问题 How can I tell objdump to emit assembly in Intel Syntax rather than the default AT&T syntax? 回答1: What you're looking for is -M intel . Use it as follows. objdump -M intel -d program_name 回答2: If you want Intel mnemonic codes as well (instead of AT&T mnemonic codes), you can use: objdump -M intel intel-mnemonic -D <program's-object-file> 来源: https://stackoverflow.com/questions/10362630/how-can-objdump-emit-intel-syntax

how to use aarch64-linux-gnu-objdump to disassemble V7 mode instructions (A32,T32)

依然范特西╮ 提交于 2019-12-18 05:06:11
问题 Im using aarch64-linux-gnu-objdump to disassemble part of a program for ARM v8. It works well for V8 64 bit instructions, but fails when the mode is changed to V7 instruction set(A32) - the code starts as V8 instruction set, switches to A32 ( AArch32 execution state) and than to T32 - thumb instruction set. how can I disassemble the A32 and T32 instructions? Do I need to break the code to parts when the mode switches, so that i have separate instruction mode blocks? any help would be

Why does objdump not show .bss, .shstratab, .symtab and .strtab sections?

自闭症网瘾萝莉.ら 提交于 2019-12-18 02:39:07
问题 I'm currently doing my own objdump implementation in C. For my -s option, I have to show the full contents of the section of an ELF file. I'm doing it well, but i'm showing more sections than the "real" objdump. In fact, it does not output the .bss, .shstrtab, .symtab and .strtab sections. I'm looking around the sh_flags value on the Shdr struct but I can't find any logic... Why objdump -s does not shows these sections ? 回答1: Why objdump -s does not shows these sections ? Objdump is based on

Buffer Overflow Attack

泪湿孤枕 提交于 2019-12-17 22:43:01
问题 I'm trying to execute a very simple buffer overflow attack. I'm pretty much a newbie to this. So, if this question is stupid, please excuse me :-) The code: #include<stdio.h> #include<stdlib.h> int i, n; void confused(int i) { printf("**Who called me? Why am I here?? *** %x\n ", i); } void shell_call(char *c) { printf(" ***Now calling \"%s\" shell command *** \n", c); system(c); } void victim_func() { int a[4]; printf("Enter n: "); scanf("%d",&n); printf("~~~~~~~~~~~~~ values and address of n

Tool to analyze size of ELF sections and symbol

孤街浪徒 提交于 2019-12-17 15:27:40
问题 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. 回答1: You can use nm and size to get the size of functions and

Flags in objdump output of object file

喜你入骨 提交于 2019-12-13 11:57:24
问题 There is this output of objdump on some object file: $ objdump -h main.o main.o: file format elf32-i386 Sections: Idx Name Size VMA LMA File off Algn 0 .text 0000000b 00000000 00000000 00000034 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .data 00000000 00000000 00000000 00000040 2**2 CONTENTS, ALLOC, LOAD, DATA 2 .bss 00000000 00000000 00000000 00000040 2**2 ALLOC 3 .note.GNU-stack 00000000 00000000 00000000 00000040 2**0 CONTENTS, READONLY, CODE What do these flags CONTENTS, ALLOC, LOAD and

C std library don't appear to be linked in object file

人走茶凉 提交于 2019-12-13 05:04:48
问题 I am using a program like this with math.h function "sin" and stdio.h function"printf" used #include <stdio.h> #include <math.h> int main () { int x = sin(14); printf("hello"); return 0; } And as stated by ephemient here that libc.so and libm.so (for math functions) should have been linked with the program , though when I run otool (similar to objdump) on the object file with the option "-L" that prints the shared libraries used, None of libc.so or libm.so are printed out otool -L com_ex1.o