How to know which shared object is used? [duplicate] - linux

This question already has answers here:
Determine direct shared object dependencies of a Linux binary?
(4 answers)
Closed 5 years ago.
This probably already has an answer but I couldn't find it.
I want to know which shared object is used by the binary (based on LD_LIBRARY_PATH, /etc/ld.so.conf, etc...). Something similar to the which command but for .so.
Thanks

You should use the ldd utility. In the same environment you would load your executable (Same LD_LIBRARY_PATH, e.t.c.)

Related

How to read the contents of a file on linux in FASM x86_64 assembly? [duplicate]

This question already has answers here:
How to read from and write to files using NASM for x86-64bit
(2 answers)
Read file from a specific position in x86
(2 answers)
Closed 8 months ago.
I'm trying to learn how to use FASM, and currently looking into manipulating files using it. But all resources I could find for it seem to be windows-only.
How could I obtain a pointer to the contents of the file, or loop over each of its lines?

Can compiled Haskell run w/o Haskell environment? [duplicate]

This question already has answers here:
Is it possible to produce stand alone haskell executable
(2 answers)
Do ghc-compiled binaries require GHC or are they self-contained?
(4 answers)
Closed 4 years ago.
I was trying to find out, whether the Haskell environment is needed to run Haskell program? For instance like Java.
Or does it work more like .net, where compiled .exe can be run on any computer wherever one copies it to?
I got this question, because in addition to normal arguments, one can give arguments for Haskell environment (+RTS -RTS) when launching an executable.

Linux command line Nodejs [duplicate]

This question already has answers here:
Read environment variables in Node.js
(8 answers)
Closed 9 years ago.
I see some NodeJS programs executed like this PARAM=1;node program.js
Im assuming its putting PARAM=1 into the environment. How do I access this in the node program? thanks,
Yes, PARAM=1 is setting an environment variable.
Depending on which shell you're using, you may need to use export PARAM=1 so the setting makes it to the child process. Otherwise the value would only exist for the shell.
As dystroy pointed out, the rest of your question is answered here.

Giving R under Linux access to a DLL [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have an R script which was developed in Windows, and which requires a particular DLL to be in the path because it uses some functions contained therein (via the dyn.load function).
Is it possible to make the script work under Linux? Perhaps using wine?
Assuming you have the source code of the non R code, I think your best bet will be to compile the code under Linux, e.g. Using a gcc compiler, create the shared library (.so file) and load it into R. If you put your code (R code and the other source code) in an R package you could integrate the R code and other source code so that they can be installed in one go, where the source is compiled on the fly.
The fact that you don't have the source code makes things quite a bit more complex. This SO post:
Using Windows DLL from Linux
Suggests to me that what you want is not trivial. One option would be to run the dll in a windows virtual machine. You then communicate using e.g. Tcp/ip to the dll running on your machine. So depending on how far you are willing to go, this might be a solution. The answers to the post above also suggest wine will not provide a satisfactory solution, but the post is quite old so wine might be improved in the meantime.

Dependency Walker equivalent for Linux? [duplicate]

This question already has answers here:
Hierarchical ldd(1)
(4 answers)
Closed 3 years ago.
I need a tool to show all the shared library dependencies in some graphical way, not just with ldd on each .so. For MS Windows Dependency Walker works. Is there anything for Linux?
.
Try binscan or ELF Library Viewer

Resources