Menu
  • HOME
  • TAGS

The alignement of a string

assembly,x86,abi

You got that wrong. A string array is an array of pointers, each pointing to a string. The array of pointers is terminated by the NULL (the 4 byte pointer). Each string in the array may be anywhere in memory, and each has its own terminating zero byte. Make a...

Boost unit test link error — abi mismatch?

c++,unit-testing,boost,linker,abi

Add -D_GLIBCXX_USE_CXX11_ABI=0 to your CPPFLAGS, then recompile. The libstdc++ that comes with gcc 5 had to make some changes to std::string and std::list for conformance with C++11. For backwards compatibility it supports a dual ABI, but it uses the new ABI by default. Your libboost_unit_test_framework.so appears to be compiled without...

Does adding enumerators into enum break ABI?

c++,enums,abi

Your question is a nice example why long-term maintaining of ABI compatibility is a difficult task. The core of the problem here is that the compatibility depends not just on the given type, but also on how it is used in function/method prototypes or complex types (e.g. structures, unions etc.)....

Why should the same compiler as the dynamic library be used for the dependent application?

c++,qt,linkage,abi

Introduction Object files and static libraries created with different compilers, or even with significantly different releases of the same compiler, often cannot be linked together. This issue is not specific to MinGW: many other compilers are mutually incompatible. Build everything from source with the same version of the same compiler...

x86_64 ABI: disassembly issue

assembly,x86-64,intel,abi

First of all, please note that you're looking at unoptimized compiler output. Compiler output often ends up looking kind of stupid with optimizations turned off because the compiler literally translates every line of C into an equivalent run of assembly without bothering to even do the simplest, most obvious optimizations....

how are the passing arguments in amd64?

gcc,x86-64,abi

Lets write a sample usecase (test.c): #include <math.h> int main() { double val = sqrt(foo(8)); return 0; } double foo(double val) { val+=1; return val; } Compile it: gcc test.c -lm And then check imported symbols: readelf -Wa a.out |grep sqrt 4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [email protected]_2.2.5 (3)...

How to call Fortran routine with unit number argument from C

c,io,fortran,shared-libraries,abi

This is completely compiler dependent, there is no portable correspondence. See the manual of your compiler if they support some sort of interoperability as an extension.

ABI call to __aeabi_idivmod doesn't behave as expected

arm,abi,stm32f4discovery

The problem is that your toolchain, by default, has its standard library compiled to ARM instructions - since the Cortex-M processors only support Thumb-2*, they will fault when attempting to use an interworking branch to ARM code. Now, the -mthumb option tells the compiler to compile your code to Thumb...

gcc x86 / x86_64 ABI : Must ss be equal to ds/es/fs/gs?

gcc,x86,x86-64,abi

Having SS different from other segment registers, especially different from the implicitly used ones (CS, DS) would not be very good idea. Most (practically all) x86 ABIs prescribe a flat address model, i.e. within the address space of a process, a 64-bit address refers to the same memory location, no...

Which implementations of the C programming language violate the following assumptions?

c,alignment,padding,abi

Alignment is not addressed by C99. It does not support any of your assumptions. Implementations are allowed free reign to insert padding -- or not -- in struct representations between members and/or at the end, however they see fit. The standard gives implementations enough freedom to serve the alignment requirements...

Why is declval present in a mangled symbol name?

c++,abi

Template functions need to have their return type appear in the mangled name because template functions can be overloaded on return type alone. A simpler example is template <typename T> void f() { } template <typename T> auto g() -> decltype(f<T>()) { } inline void h() { } int main()...

How to program in 16 bit protected mode with more than 64kb of data?

assembly,abi,protected-mode,80286

Most 16-bit protected mode APIs took far pointers as parameters. A far pointer is a 32-bit value containing both a 16-bit offset (low order word) and a 16-bit selector (high order word, selectors refer to segments). It's passed by value by putting it on the stack like any other parameter....