readelf

readelf vs. objdump: why are both needed

两盒软妹~` 提交于 2019-12-03 04:14:01
问题 I need to learn about the ELF file layout for a project I am working on and I noticed the existence of these tools. Why do all Linux distributions include both readelf and objdump? Do these tools complement one another? When would i prefer to use one over another? 回答1: from binutils/readelf.c: /* The difference between readelf and objdump: Both programs are capabale of displaying the contents of ELF format files, so why does the binutils project have two file dumpers ? The reason is that

Incorrect function size inside ARM ELF object

守給你的承諾、 提交于 2019-12-02 21:48:03
问题 readelf output of the object file: Symbol table '.symtab' contains 15 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS fp16.c 2: 00000000 0 SECTION LOCAL DEFAULT 1 3: 00000000 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 SECTION LOCAL DEFAULT 4 5: 00000000 0 NOTYPE LOCAL DEFAULT 1 $t 6: 00000001 194 FUNC LOCAL DEFAULT 1 __gnu_f2h_internal 7: 00000010 0 NOTYPE LOCAL DEFAULT 5 $d 8: 00000000 0 SECTION LOCAL DEFAULT 5 9:

gcc编译生成静态及动态链接库步骤

北城以北 提交于 2019-12-02 18:25:57
这两天在看《Linux C程序设计大全》,吴岳编著,清华大学出版社。这本书是在一个培训机构看到的,在网上查了下该书的相关信息。从目录而言,该书涵盖了Linux下C程序设计的较多内容,包括C语言基础(主要讲解C语法结构)、C语言开发环境(主要介绍VIM使用、GCC使用、makefile编写、gdb使用)、Linux进程操作、Linux文件操作、Linux网络编程这几部分。阅读了该书几个小章节,总体而言,书的部分内容较充实,但是存在较多编辑错误,部分样例实际运行时与书中内容不符。 这里使用该书P192-P199的例子,总结下gcc编译静态及动态链接库的方法及步骤。 程序清单如下: test.c文件内容: int add(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } int mul(int a, int b) { return a * b; } int div(int a, int b) { return a / b; } test.h文件内容: #ifndef _TEST_H_ #define _TEST_H_ extern int add(int a, int b); extern int sub(int a, int b); extern int mul(int a, int b);

readelf vs. objdump: why are both needed

可紊 提交于 2019-12-02 16:36:12
I need to learn about the ELF file layout for a project I am working on and I noticed the existence of these tools. Why do all Linux distributions include both readelf and objdump? Do these tools complement one another? When would i prefer to use one over another? from binutils/readelf.c: /* The difference between readelf and objdump: Both programs are capabale of displaying the contents of ELF format files, so why does the binutils project have two file dumpers ? The reason is that objdump sees an ELF file through a BFD filter of the world; if BFD has a bug where, say, it disagrees about a

ldd equivalent on android

☆樱花仙子☆ 提交于 2019-11-30 06:06:18
I have a libTest.so that does not load on some devices. logcat is absolutely useless. Using arm-linux-androideabi-readelf.exe -d libTest.so I was able to see all required libs that libTest.so needs. I pulled them all in, into the same folder on my local PC. How can I find out which symbols is missing and in which library? I have only standard set of tools from the NDK (nm, readelf, objdump etc). Which tool and how can I use so that it parses my libTest.so and all dependent libs as well and tells me which symbol prevents my lib from loading on the target device. Thanks to android developers. My

ldd equivalent on android

安稳与你 提交于 2019-11-29 05:49:15
问题 I have a libTest.so that does not load on some devices. logcat is absolutely useless. Using arm-linux-androideabi-readelf.exe -d libTest.so I was able to see all required libs that libTest.so needs. I pulled them all in, into the same folder on my local PC. How can I find out which symbols is missing and in which library? I have only standard set of tools from the NDK (nm, readelf, objdump etc). Which tool and how can I use so that it parses my libTest.so and all dependent libs as well and