dynamic-linking

instruction point value of dynamic linking and static linking

允我心安 提交于 2020-07-09 11:54:09
问题 By using Intel's pin, I printed out the instruction pointer (ip) values for a program with dynamic linking and static linking. And I've found that their ip values are quite different, even though they are the same program. A program with static linking shows 0x400f50 for its very first ip value. but a program with dynamic linking shows 0x7f94f0762090 for its first ip value I am not sure why they have that quite a large gap. It would be appreciated if anyone could help me find out the reason

How to understand the difference between Offset and VirAddr in Program Headers in elf?

旧街凉风 提交于 2020-06-28 05:43:18
问题 There is a shared library elf file, I use readelf -l to see the program headers, the output is: Elf file type is DYN (Shared object file) Entry point 0x0 There are 11 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00100 0x00100 R 0x4 INTERP 0x000194 0x00000194 0x00000194 0x00013 0x00013 R 0x1 [Requesting program interpreter: /system/bin/linker] LOAD 0x000000 0x00000000 0x00000000 0x3aa8c4

Linking freetype with cmake

ε祈祈猫儿з 提交于 2020-06-14 05:03:31
问题 I'm having troubles with linking freetype 2 under linux using cmake when building a C++11 project with an extern C library. With cmake and freetype 2 I basically have 2 options : use the utility freetype-config like freetype-config --libs use the FindFreetype cmake module Now I'm trying to implement the second option and I'm not very skilled with cmake nor I understand the logic of it. My problem is the linking phase, I have no idea how to do that properly plus this module is not as complete

Firebase unable to edit dynamic link behavior for android app from console

不想你离开。 提交于 2020-06-01 05:14:10
问题 When editing dynamic links in my Android Firebase app I try to define the link behavior for Android by choosing "Open the deep link in your Android app", followed by pressing Next "if your app is not installed, send the user to" Firebase will not save a change from 'Google Play page for your app" to "Custom URL or Google Play Instant Experience". It "edits" successfully, and then is back to the previous setting when I check it. 来源: https://stackoverflow.com/questions/62029462/firebase-unable

Exporting symbols in static library that is linked to dynamic library

╄→尐↘猪︶ㄣ 提交于 2020-04-16 02:51:46
问题 I have the following scenario in MSVC2017: A static library with the function bool foo() A dynamic link library that links to the static library above An application that loads the dynamic link library using explicit run-time linking and calls foo() via GetProcAddress In the static library, foo() is defined as follows: extern "C" __declspec(dllexport) bool foo() { return true; } Now, because foo() is not used by the dynamic link library, its symbol is not exported and thus not findable when

How to link to an xxx.dll when the provider only ships it with an xxx.lib and you are using MinGW-w64 and not MSVC?

こ雲淡風輕ζ 提交于 2020-02-23 07:50:29
问题 Firebird and Boost communities only provide the xxx.lib for their pre-built xxx.dll binaries, and I am using MinGW-w64 v7.0.0 with GCC v8.1.0 , and this last one expects a libxxx.a file containing all the xxx.dll function symbols to link with. For Boost , I can build it from the source code for MinGW-w64 (though I still prefer using the pre-built ones, because the build process for big toolkits like this one takes forever). As for Firebird , it is not buildable using MinGW-w64 at all, except

Hook function to shared library unloading

狂风中的少年 提交于 2020-02-22 07:34:25
问题 I want to add hook function, which will be called when shared library is unloaded. Library is linked on complitaion. Is it possible to do such thing? Maybe gcc has flag for it? I saw similar solution for loading library on runtime, but it doesn't meet my expectations. 回答1: Solaris and GNU/Linux support the LD_AUDIT interface in their dynamic linkers. You need to load an auditor module which implements the la_objclose callback function: Runtime Linker Auditing Interface The implementation can

Hook function to shared library unloading

笑着哭i 提交于 2020-02-22 07:33:45
问题 I want to add hook function, which will be called when shared library is unloaded. Library is linked on complitaion. Is it possible to do such thing? Maybe gcc has flag for it? I saw similar solution for loading library on runtime, but it doesn't meet my expectations. 回答1: Solaris and GNU/Linux support the LD_AUDIT interface in their dynamic linkers. You need to load an auditor module which implements the la_objclose callback function: Runtime Linker Auditing Interface The implementation can

How to I find the filename of a library via the library name?

╄→尐↘猪︶ㄣ 提交于 2020-01-31 04:44:04
问题 How to I find the filename of a library via the library name? In otherwords, when I use "-lc", I know it is /lib/libc.so.6 (or something similar.) I want to be able to type some command where "-lc" is the input and "/lib/libc.so.6" is the output. To extend this idea futher, I wanted to specify my own search path so I can use this library resolver for different toolchains... Any help would be awesome, Thanks Chenz 回答1: If you want to find out where a given GCC will find libc.a or libc.so, do

Weak symbol aliases on OS X similar to those on Linux, or a closest equivalent?

纵然是瞬间 提交于 2020-01-31 00:54:26
问题 What I do When writing shared libraries for Linux, I tend to pay attention to relocations, symbol visibility, GOT/PLT etc. When applicable, I am trying to avoid calling PLT stubs when functions from the same library call each other. For example, let's say a shared object provides two public functions - foo() and bar() (either of those can be called by user). The bar() function, however, also calls foo() . So what I do in this case is this: Define _foo() and _bar() functions that have private