elf

How does adding a private member variable break C++ ABI compatibility?

痴心易碎 提交于 2019-11-30 06:52:10
The pimpl idiom is commonly used in order to allow changing code in dynamically linked libraries without breaking ABI compatibility and having to recompile all the code that depends on the library. Most of the explanations I see mention that adding a new private member variable changes the offsets of public and private members in the class. That makes sense to me. What I don't understand is how in practice this actually breaks the dependent libraries. I've done a lot of reading on ELF files and how dynamic linking actually works, but I still don't see how changing the class size in the shared

Force GNU linker to generate 32 bit ELF executables

一笑奈何 提交于 2019-11-30 06:37:07
Hi I am currently generating x86 assembly for a compiler that I am writing and am having some trouble linking the file on my 64-bit VM (the assembly code is 32 bit). I was able to assemble the object file fine with this command: as --32 mult.S -o mult.o but I can't seem to find any options for ld that make it generate a 32-bit ELF file: ld <some-option?> mult.o -o mult Any help would be great. Employed Russian ld <some-option?> mult.o -o mult ld -m elf_i386 mult.o -o mult You can get a list of available architectures with: ld -V Sample output: GNU ld (GNU Binutils for Ubuntu) 2.24 Supported

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

对着背影说爱祢 提交于 2019-11-30 05:08:35
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 point without this knowledge. I tried debug my program step by step with gdb but it goes into __libc

Is there a downside to using -Bsymbolic-functions?

帅比萌擦擦* 提交于 2019-11-30 01:42:53
I recently discovered the linker option "-Bsymbolic-functions" in GNU ld: -Bsymbolic When creating a shared library, bind references to global symbols to the definition within the shared library, if any. Normally, it is possible for a program linked against a shared library to override the definition within the shared library. This option is only meaningful on ELF platforms which support shared libraries. -Bsymbolic-functions When creating a shared library, bind references to global function symbols to the definition within the shared library, if any. This option is only meaningful on ELF

Linking error with `libopencv_highgui.so` under Ubuntu 14.04, strange result with `libtiff.so.5`

跟風遠走 提交于 2019-11-30 01:42:29
问题 Problem I'm compiling the deep learning library Caffe in Ubuntu 14.04(64 bit). OpenCV( Version: 2.4.8+dfsg1-2ubuntu1 ) is installed from ubuntu packages server with : sudo apt-get install libopencv-dev Compile Caffe with CMake 2.8. Linking error: Linking CXX executable caffe- /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.8: undefined reference to `TIFFOpen@LIBTIFF_4.0' Infomation It seems some symbols of TIFF library were not found. I made some effort to find the reason(without luck).

Why does the compiler version appear in my ELF executable?

杀马特。学长 韩版系。学妹 提交于 2019-11-30 01:19:16
问题 I've recently compiled a simple hello world C program under Debian Linux using gcc: gcc -mtune=native -march=native -m32 -s -Wunused -O2 -o hello hello.c The file size was 2980 bytes. I opened it in a hex editor and i saw the following lines: GCC: (Debian 4.4.5-8) 4.4.5 GCC: (Debian 4.4.5-10) 4.4.5 .shstrtab .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .text .fini .rodata .eh_frame .ctors .dtors .jcr .dynamic .got .got

Floating point exception ( SIGFPE ) on 'int main(){ return(0); }'

Deadly 提交于 2019-11-29 20:07:18
I am trying to build a simple C program for two different Linux environments. On one device the program runs fine, on the other device the program generates a floating point exception. The program does nothing but return 0 from main which leads me to believe there is some incompatibility with the start-up code perhaps ABI? The program is compiled with gcc with the following build specs: Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release -

What are the meanings of the columns of the symbol table displayed by readelf?

倖福魔咒の 提交于 2019-11-29 19:57:44
Could someone explain the columns shown of the symbol table using readelf ? Caladain Consider the following: Symbol table .symtab contains 1203 entries: Num: Value Size Type Bind Vis Ndx Name 310: a0008120 0 NOTYPE GLOBAL DEFAULT ABS _gp 734: a0000010 32 OBJECT GLOBAL DEFAULT 77 v 818: 9d000018 496 FUNC GLOBAL DEFAULT 71 main 849: a0000124 4 OBJECT GLOBAL DEFAULT 78 phrase 955: a0000000 9 OBJECT GLOBAL DEFAULT 77 peppers 1020: a000023c 192 OBJECT GLOBAL DEFAULT 80 bins Num: = The symbol number Value = The address of the Symbol Size = The size of the symbol Type = symbol type: Func = Function,

arm gcc toolchain as arm-elf or arm-none-eabi, what is the difference?

送分小仙女□ 提交于 2019-11-29 19:25:56
When you build a gcc toolchain there is the possibility to build it as arm-elf or as arm-none-eabi, but what is the difference? I use the eabi today, but that is just since everyone else seem to do that... but since that is a really bad argument, it would be really nice to understand the difference. Note: This toolchain will crosscompile code for Cortex-M3 based mcu:s like the stm32. Thanks Some links : EABI: http://en.wikipedia.org/wiki/Application_binary_interface http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.swdev.abi/index.html ELF: http://en.wikipedia.org/wiki

ELF Dynamic loader symbol lookup ordering

喜欢而已 提交于 2019-11-29 18:55:46
问题 What is the search order for symbol lookup when resolving dynamic relocations? When resolving symbols for a shared library does the loader first search in the 'main executable' (to let the main executable override definitions...) or what? 回答1: Per my understanding, each executable object has its own "lookup scope": The main executable is usually the first object in the "global" lookup scope. This means that symbols defined in the main executable would override those in dependent shared