abi

Setting extra bits in a bool makes it true and false at the same time

有些话、适合烂在心里 提交于 2019-11-28 22:23:46
If I get a bool variable and set its second bit to 1, then variable evaluates to true and false at the same time. Compile the following code with gcc6.3 with -g option, ( gcc-v6.3.0/Linux/RHEL6.0-2016-x86_64/bin/g++ -g main.cpp -o mytest_d ) and run the executable. You get the following. How can T be equal to true and false at the same time? value bits ----- ---- T: 1 0001 after bit change T: 3 0011 T is true T is false This can happen when you call a function in a different language (say fortran) where true and false definition is different than C++. For fortran if any bits are not 0 then the

What are the purposes of the ARM ABI and EABI?

删除回忆录丶 提交于 2019-11-28 15:20:31
问题 The more I look at this PDF the less I understand what it means. Also I'd like some comments on this others 1 and 2. 回答1: An ABI ( Application Binary Interface ) is a standard that defines a mapping between low-level concepts in high-level languages and the abilities of a specific hardware/OS platform's machine code. That includes things like: how C/C++/Fortran/... data types are laid out in memory (data sizes / alignments) how nested function calls work (where and how the information on how

Difference between API and ABI

会有一股神秘感。 提交于 2019-11-28 14:56:52
I am new to linux system programming and I came across API and ABI while reading Linux System Programming . Definition of API : An API defines the interfaces by which one piece of software communicates with another at the source level. Definition of ABI : Whereas an API defines a source interface, an ABI defines the low-level binary interface between two or more pieces of software on a particular architecture. It defines how an application interacts with itself, how an application interacts with the kernel, and how an application interacts with libraries. How can a program communicate at a

Call C/C++ function from assembly (OSX Mavericks x64)

老子叫甜甜 提交于 2019-11-28 14:13:55
This is a weird issue that I can't seem to find an answer to. This: #include <iostream> using namespace std; void show_number(int number) { cout << number << endl; // Shows '10' as expected } int main() { cout << endl; // Remove this and it fails __asm { mov rdi, 10 call show_number } } actually works fine, except when you remove the initial cout << endl (first line of main ). When you remove it, the cout in show_number seems to cause a segfault for some reason. What causes this? (OSX Mavericks x64, but should work in linux as well I think) Macmade The Mac OS X ABI requires a 16-bytes stack

Using Scala 2.12 with Spark 2.x

谁说我不能喝 提交于 2019-11-28 08:10:45
At the Spark 2.1 docs it's mentioned that Spark runs on Java 7+, Python 2.6+/3.4+ and R 3.1+. For the Scala API, Spark 2.1.0 uses Scala 2.11. You will need to use a compatible Scala version (2.11.x). at the Scala 2.12 release news it's also mentioned that: Although Scala 2.11 and 2.12 are mostly source compatible to facilitate cross-building, they are not binary compatible. This allows us to keep improving the Scala compiler and standard library. But when I build an uber jar (using Scala 2.12) and run it on Spark 2.1. every thing work just fine. and I know its not any official source but at

glibc: elf file OS ABI invalid

别等时光非礼了梦想. 提交于 2019-11-28 07:27:40
downloaded and compiled glibc-2.13. when i try to run a sample C program which does a malloc(). I get following error elf file OS ABI invalid Can anybody please pass my any pointer helpful in resolving this issue.Please note that my kernel version is linux-2.6.35.9 mkj It's not your kernel version that's the problem. The loader on your system does not support the new Linux ABI. Until relatively recently, Linux ELF binaries used the System V ABI. Recently, in support of STT_GNU_IFUNC, the Linux ABI was added. You would have to update your system C library to have a loader that support STT_GNU

Is it valid to write below ESP?

你说的曾经没有我的故事 提交于 2019-11-28 07:13:09
问题 For a 32-bit windows application is it valid to use stack memory below ESP for temporary swap space without explicitly decrementing ESP? Consider a function that returns a floating point value in ST(0) . If our value is currently in EAX we would, for example, PUSH EAX FLD [ESP] ADD ESP,4 // or POP EAX, etc // return... Or without modifying the ESP register, we could just : MOV [ESP-4], EAX FLD [ESP-4] // return... In both cases the same thing happens except that in the first case we take care

g++ always backward-compatible with “older” static libraries?

被刻印的时光 ゝ 提交于 2019-11-28 06:32:23
I have a few static libraries, which I'm not the owner of, compiled with an old version of g++ 4.3.2 (c++11/c++0x not activated). When I compile my code with g++ 4.6 (no c++11) and link it using g++ 4.6 with these static libraries, it links fine and I do not seem to get any issues at runtime (not tested everything though). I'm tempted to think that forward compatibility is OK. Now I'd like to compile my code with gcc 4.8 with c++11 and still link it with those same, not recompiled static libraries. Are ABI changes in g++ only an issue for linkage forward compatibility or can one get backward

Why do we need stack allocation when we have a red zone?

南楼画角 提交于 2019-11-28 03:49:25
问题 I have the following doubts: As we know System V x86-64 ABI gives us about a fixed-size area (128 bytes) in the stack frame, so called redzone. So, as a result we don't need to use, for example, sub rsp, 12 . Just make mov [rsp-12], X and that's all. But I cannot grasp idea of that. Why does it matter? Is it necessary to sub rsp, 12 without redzone? After all, stack size is limited at the beginning so why sub rsp, 12 is important? I know that it makes possible us to follow the top of the

i386 vs. AMD64 ABI Differences

徘徊边缘 提交于 2019-11-28 01:20:57
Where can I find all the differences in data types between the i386 & AMD64 Application Binary Interface(ABI)s ? I know that the long type is 32-bit in i386 ABI & 64-bit in AMD64. Is this correct? Necrolis I suggest you download Dr Agner Fog's optimization manuals . He has a manual specifically about ABIs and their differences. For differences in the instruction set between 32-bit mode and 64-bit mode, both Intel and AMD's instruction manuals should cover this in the introductory volume or the volumes after the instruction volumes( 2a and 2b for Intel's instruction set reference , or 2 and 3