elf

修复/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory问题

好久不见. 提交于 2020-01-02 15:21:57
修复/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory问题 背景 刚刚安装的CentOS 7.5 Mini版本系统,然后配置JDK环境,配置好后显示: [root@jenkins opt]# tail -3 /etc/profile export JAVA_HOME=/opt/jdk1.8.0_191 export JRE_HOME=$JAVA_HOME/jre export PATH=$PATH:$JAVA_HOME/bin [root@jenkins opt]# source /etc/profile [root@jenkins opt]# java -V -bash: /opt/jdk1.8.0_191/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 报错了。。。根据提示查了下,发现缺少了 glibc.i686.... 通过查询,只要 在64系统里执行32位程序如果出现/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory,安装下glic即可 yum install glibc.i686 来源: https:/

修复/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory问题

你离开我真会死。 提交于 2020-01-02 15:21:33
在配置MongDB的是时候出现这/lib/ld-linux.so.2问题 [root@localhost local]# /usr/local/mongodb/mongodb/bin/mongod --dbpath=/usr/local/mongodb/mongodb/data --logpath=/usr/local/mongodb/mongodb/logs --logappend --auth --port=27017 --fork -bash: /usr/local/mongodb/mongodb/bin/mongod: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory [root@localhost local]# 1、在64 系统 里执行32位程序如果出现/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory,安装下glic即可 sudo yum install glibc.i686 2、error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory sudo

__start_section and __stop_section symbols missing when linking to library

試著忘記壹切 提交于 2020-01-02 09:17:00
问题 I'm using custom elf headers in an autotools C project similar to this thread: How do you get the start and end addresses of a custom ELF section in C (gcc)?. The problem is that the c files that declare the custom sections are linked into a static library which is then linked to the final application. In this configuration the symbols __start_custom_section and __stop_custom_section do not get generated. I define the elf section like this: struct mystruct __attribute((__section__("custom

Get the address that caused segmentation fault from core dump using C

血红的双手。 提交于 2020-01-01 04:16:10
问题 I am trying to write a C program that can parse core dump files. My question is, how can I get the address that caused the core dump in C? I know one can get the address using gdb from this answer: How can I get GDB to tell me what address caused a segfault? But I would like to directly retrieve the address in C. Any information would be highly appreciated. Thanks! Notice: I know how to parse core dump as an elf. But I don't know how to get the address that caused the segfault. 回答1: My

String table in ELF

杀马特。学长 韩版系。学妹 提交于 2020-01-01 02:40:08
问题 I get some symbol and I get the hexedit of an elf file. How can I know in which section this symbol appear? What is the different between strtab and shstrtab ? there is also an array of symbol strings? When I get index in the names table, is it index in strtab or shstrtab ? 回答1: For the first question, we would need the hexedit of the elf file to understand properly. For the second question - strtab stands for String Table shstrtab stands for Section Header String table. When we read ELF

a.out replaced by ELF file format?

喜你入骨 提交于 2019-12-31 21:24:10
问题 I have a few questions: Why was a.out replaced by ELF ? What were the major flaws in the a.out format that led to the raise of ELF file format? Earlier core dumps were based on a.out, but now they are based on ELF. What are the various advantages provided by ELF? 回答1: The a.out format forced shared libraries to occupy a fixed place in memory. If you wanted to distribute an a.out shared library, you had to register its address space. This was good for performance but it didn't scale at all.

How does the Linux kernel determine ld.so's load address?

梦想与她 提交于 2019-12-30 10:34:34
问题 I know that the dynamic linker uses mmap() to load libraries. I guess it is the kernel who loads both the executable and its .interp reter into the same address space, but how does it determine where? I noticed that ld.so 's load address with ASLR disabled is 0x555555554000 (on x86_64) — where does this address come from? I tried following do_execve() 's code path, but it is too ramified for me not to be confused as hell. 回答1: Read more about ELF, in particular elf(5), and about the execve(2)

Where are global variables located in the elf file

十年热恋 提交于 2019-12-30 04:34:14
问题 I want to learn about elf files, but when I think of global variables, global static variables and scope static variables, I have some confusion. For example: int a = 2; int b; static int c = 4; static int d; void fun(){ static int e = 6; static int f; } int main(void){ fun(); } Who can tell which segment each variable belongs to? in my opinion, b , d and f belong to the .bss segment and a , c and e belong to the data segment, but I don't know the difference between global static variables

How to find the main function's entry point of elf executable file without any symbolic information?

纵然是瞬间 提交于 2019-12-30 01:21:25
问题 I developed a small cpp program on platform of Ubuntu-Linux 11.10. Now I want to reverse engineer it. I am beginner. I use such tools: GDB 7.0, hte editor, hexeditor . For the first time I made it pretty easy. With help of symbolic information I founded the address of main function and made everything I needed. Then I striped ( --strip-all ) executable elf-file and I have some problems. I know that main function starts from 0x8960 in this program. But I haven't any idea how should I find this

understanding the __libc_init_array

你。 提交于 2019-12-29 19:28:38
问题 I viewed the source code of __libc_init_array from http://newlib.sourcearchive.com/documentation/1.18.0/init_8c-source.html . But I don't quite understand what this function does. I know that these symbols /* These magic symbols are provided by the linker. */ extern void (*__preinit_array_start []) (void) __attribute__((weak)); extern void (*__preinit_array_end []) (void) __attribute__((weak)); extern void (*__init_array_start []) (void) __attribute__((weak)); extern void (*__init_array_end [