shared-libraries

Why is the startup of an App on linux slower when using shared libs?

北城以北 提交于 2019-12-02 11:16:58
问题 On the embedded device I'm working on, the startup time is an important issue. The whole application consists of several executables that use a set of libraries. Because space in FLASH memory is limited we'd like to use shared libraries. The application workes as usual when compiled and linked with shared libraries and the amount of FLASH memory is reduced as expected. The difference to the version that is linked to static libs is that the startup time of the application is about 20s longer

Calling C shared library function from LibreOffice Basic

China☆狼群 提交于 2019-12-02 10:13:24
I'm trying to call a C shared library function from LibreOffice Basic, but I always get "Basic Runtime Error. Not implemented" when it hits the Declare line. It's just for a fun thing but being unable to do it is bugging me. The Declare statement looks like this: Declare Function score_word Lib "libscrabblescore.so" (ByRef word As String, ByRef bonus As String) As Integer The C function delaration looks like this: int score_word(char* word, char* word_bonuses) (Maybe ByRef word As String is not the right translation of char* word? I can't find documentation on how to use char* parameters to

Hack the standard function in library and call the native library function afterwards

拜拜、爱过 提交于 2019-12-02 09:02:06
I am trying to hack the malloc function to call my malloc function first.Once my malloc function is executed within that, I want to invoke the standard malloc. But, I am getting a recursion, since it is just loading my defined malloc. How can i fix the below code? #include <dlfcn.h> #include "stdio.h" //#include "stdlib.h" void *handle; void *handle_malloc; int (*loadprg)(void); void * (*malloc_sysm)(size_t); void init() { handle = dlopen ("/export/home/joshis1/Foxtel/temp/libloadmap.so", RTLD_LAZY); if( handle == NULL) { puts(dlerror()); } handle_malloc = dlopen ("/lib/libc.so.6", RTLD_LAZY);

Compile shared library into a program?

和自甴很熟 提交于 2019-12-02 08:19:41
I wrote a program, that uses a shared library installed on my system. This library is seldom installed on other systems. How do I compile my program so that the library doesn't need to be installed on other systems? I have the source code for the library available. What's the best way? The other systems of course have the same architecture and OS. Compile it as a static library and link that into the executable. Though the OP had solved his problem by answering a different question, there are (at least) two ways to wedge a shared library into your binary in case there is no source code

Is all MIPS code on Linux supposed to be PIC?

て烟熏妆下的殇ゞ 提交于 2019-12-02 07:55:45
问题 In Linux on MIPS CPUs (MIPSEL32 to be precise), is it true that all userland SO's are supposed be position independent (PIC)? A cite from an authoritative source would be the the best. How about Android? My interest stems from this. 回答1: The situation with PIC code on Linux appears to be somewhat interesting. In the past (pre EGLIBC-2.9) all binaries on MIPS where supposed to be PIC (both applications and shared libraries). However, to reduce the size of applications, the ABI extension was

Invalid mex-file, libarmadillo, cannot open shared object file

筅森魡賤 提交于 2019-12-02 07:11:27
问题 I know there are a lot of posts about the topic, this might be a duplicate, but I don't think so. My config is: Matlab R2014b, clang 3.4, Ubuntu 14.04, armadillo-4.600.4. I have a local install (not system-wise, so including/linking manually) of Armadillo that works fine when outside of Matlab. I'm trying to run a Mex file using Armadillo from Matlab. It compiles fine using the command (truncated for short): mex -compatibleArrayDims -outdir +mx -L/home/john/.local/arma/lib -larmadillo -I/home

Questions about shared libraries

时光怂恿深爱的人放手 提交于 2019-12-02 06:54:12
问题 I have some question regarding shared libraries Who will load shared libraries when I run binary depends on shared libraries(.so)? Where shared libraries loaded? If shared libraries were already loaded and I run binary depends on loaded libraries, in this case shared libraries will going to be loaded or binary will use loaded libraries? 回答1: Who will load shared libraries when I run binary depends on shared libraries(.so)? When you exec s the binary, the Linux kernel will read elf header of

Is it possible to create such C++ macros that would wrap your standard (inherited) class into an application?

好久不见. 提交于 2019-12-02 06:32:57
问题 So we have simple interface base class: class animal { public: animal(int age) : age_(age) { } virtual ~animal(void) { } virtual std::string get_name(void) { return "A generic animal"; } int get_age(void) { return age_; } protected: int age_; }; And we want ti inherit from it with a class like this: #include "animal.hpp" #include "some_includes_for_our_shared_libs.hpp" class puma : public animal { public: puma(int age) : animal(age) {} virtual std::string get_name() { return "puma"; } }; If

Why is the startup of an App on linux slower when using shared libs?

北城余情 提交于 2019-12-02 05:19:07
On the embedded device I'm working on, the startup time is an important issue. The whole application consists of several executables that use a set of libraries. Because space in FLASH memory is limited we'd like to use shared libraries. The application workes as usual when compiled and linked with shared libraries and the amount of FLASH memory is reduced as expected. The difference to the version that is linked to static libs is that the startup time of the application is about 20s longer and I have no idea why. The application runs on an ARM9 CPU at 180 MHz with Linux 2.6.17 OS, 16 MB FLASH

Is all MIPS code on Linux supposed to be PIC?

↘锁芯ラ 提交于 2019-12-02 05:18:20
In Linux on MIPS CPUs (MIPSEL32 to be precise), is it true that all userland SO's are supposed be position independent (PIC)? A cite from an authoritative source would be the the best. How about Android? My interest stems from this . The situation with PIC code on Linux appears to be somewhat interesting. In the past (pre EGLIBC-2.9) all binaries on MIPS where supposed to be PIC (both applications and shared libraries). However, to reduce the size of applications, the ABI extension was developed to allow for non-PIC executables (but shared objects stay PIC, as before): At this time we do not