abi

X86-64 NASM calling extern c functions

我是研究僧i 提交于 2019-12-02 13:59:11
Im very new to assembly but know a bit of c. Im playing around with extern function calls like extern _printf str db "Hello", 0 push str call _printf but cant find any tutorials using extern functions except scanf and printf. For example strcmp? How can i call strcmp in my case? Micrified Here is my answer. It is specific to x86-64 though. Please know that when pushing arguments to a function, you usually place the first 6 in registers rdi , rsi , rdx , rcx , r8 , and r9 . The rest get pushed to the stack. The specification for this is called the System V ABI (Note that Windows uses a

How to safely deploy an application built with an upgraded compiler

爱⌒轻易说出口 提交于 2019-12-02 13:13:37
I have an application that is deployed on a centos 6.7 plateform and built with the native C++ compiler of the distribution, that is gcc 4.4.7. Now for some reasons ( actually, upgrade to Qt 5.7 ), i need to use a modern compiler with C++11 features fully supported, let's say gcc 4.8.2 from devtoolset-2. Another possibility was to built a new version of gcc from the sources. According to https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html the 4.8.3 (but 4.8.2 is not mentionned ) version of gcc is backward compatible with the libstdc++.6.0.13 ( default c++ lib in centos 6.7 ). I have

APK completely shadowed with multiple ABI APKs

こ雲淡風輕ζ 提交于 2019-12-02 12:28:37
UPDATE: tried lowering "v7a" ABI versionCode to prefix 4 (lower than 5 which is "v8") without any luck Currently my app is in Alpha stage. Every APK was generated by the same ABI split and the same version multiplication for each ABI (code included), to both "armeabi-v7a", and to "arm64-v8a". Even though I have uploaded only "v8a" APK until now. Now when I'm trying to upload the "v7a" I'm getting the following error from google play console: Problem: This APK will not be served to any users because it is completely shadowed by one or more APKs with higher version codes. Resolution: Remove this

Binary compatibility between VS2017 and VS2015

徘徊边缘 提交于 2019-12-02 02:12:49
This SO post: Is Visual-C++-2017 binary compatible with VC++-2015? clearly says that VS 2017 is binary compatible with VS 2015. It even looks like the official position. My question is, in the past, I distinctly remember running into linker errors (I do not recall the specific set of errors) every time I try to link in a static library that was compiled with a different version of MSVC into an EXE that is being built with a newer version of MSVC. Yet, binary (in)compatibility sounds like something that will blow up in your face at runtime , not link time. Can someone tell me if previous

How to use c library function fgets in assembly language?

喜夏-厌秋 提交于 2019-12-02 01:19:30
问题 As the title described, how to use c library function fgets in assembly language? Indeed, I want to know how to get the file pointer to stdin. Thanks for your reply. 回答1: you can write a simple program using fgets and compile it with gcc -S to see how to do it 来源: https://stackoverflow.com/questions/2567055/how-to-use-c-library-function-fgets-in-assembly-language

Why would the ELF header of a shared library specify Linux as the OSABI?

佐手、 提交于 2019-12-01 16:59:45
All the standard shared libraries on my Linux system (Fedora 9) specify ELFOSABI_NONE (0) as their OSABI. This is fine - however I've received a shared library from a supplier where the OSABI given in the ELF header is ELFOSABI_LINUX (3). This doesn't sound like an unreasonable value for a shared library intended for a Linux system, however it is a different value to that of all my other libraries - and so when I try to open this library, with dlopen(), from one of my other libraries this fails with the error "ELF file OS ABI invalid". I compiled up the FreeBSD utility brandelf.c and used it

Android 世界中,谁喊醒了 Zygote ?

断了今生、忘了曾经 提交于 2019-12-01 10:33:39
本文基于 Android 9.0 , 代码仓库地址 : android_9.0.0_r45 文中源码链接: SystemServer.java ActivityManagerService.java Process.java ZygoteProcess.java 对 Zygote 和 SystemServer 启动流程还不熟悉的建议阅读下面两篇文章: Java 世界的盘古和女娲 —— Zygote Zygote 家的大儿子 —— SystemServer Zygote 作为 Android 世界的受精卵,在成功繁殖出 system_server 进程之后并没有完全功成身退,仍然承担着受精卵的责任。 Zygote 通过调用其持有的 ZygoteServer 对象的 runSelectLoop() 方法开始等待客户端的呼唤,有求必应。客户端的请求无非是创建应用进程,以 startActivity() 为例,假如开启的是一个尚未创建进程的应用,那么就会向 Zygote 请求创建进程。下面将从 客户端发送请求 和 服务端处理请求 两方面来进行解析。 客户端发送请求 startActivity() 的具体流程这里就不分析了,系列后续文章会写到。我们直接看到创建进程的 startProcess() 方法,该方法在 ActivityManagerService 中,后面简称 AMS 。

What are the real ELF TLS ABI requirements for each cpu arch?

核能气质少年 提交于 2019-12-01 03:49:29
Ulrich Drepper's paper on thread-local storage outlines the TLS ABI for several different cpu architectures, but I'm finding it insufficient as a basis for implementing TLS for two reasons: It omits a number of important archs like ARM, MIPS, etc. (while including a bunch of completely-irrelevant ones like Itanium) More importantly, it mixes a lot of implementation details with ABI, so that it's hard to tell which properties are required for interoperability, and which are just aspects of his implementation. As an example, the only actual ABI requirements for i386 are: %gs:0 points to a

To what extent does the Itanium ABI really specify padding and alignment?

自闭症网瘾萝莉.ら 提交于 2019-12-01 03:02:44
I've been told: [ABIs] guarantee the exact layout of the struct, byte offset of every member, which bits are used for bit fields, where and how much padding there is, etc... But I've always believed that padding and alignment were unspecified and unreliable. Does the Itanium ABI (which GCC uses) in fact specify these things (as far as I can tell, it doesn't appear to beyond specifying ranges)? And if it does, how do options like __attribute__ ((packed)) fit into that? Do they ultimately break the ABI by altering the alignment of things? Or, as the quotee implies, is packing merely unspecified

Which registers are safe to use in a function (x86)

人盡茶涼 提交于 2019-12-01 01:32:22
问题 According to Wikipedia the Intel ABI allows using EAX , ECX and EDX without preserving them in a function. I am not sure what "Intel ABI" means. Does this mean it is enforced/followed by all compilers targeting Intel CPUs? I am writing an assembly function that will be called from C code. Can I assume this for all compilers? (I am only targeting x86 at the moment) 回答1: The Intel ABI is just a calling convention established by Intel. In general, how parameters are passed and which registers