Skip to content
Advertisement

Tag: dynamic-loading

Overlapping mappings for loaded ELF segments

I’d like to understand a detail of how the dynamic loader creates mappings for ELF segments. Consider a tiny shared library linked with GNU ld. The program headers are: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x00095c 0x00095c R E 0x200000 LOAD 0x000df8 0x0000000000200df8 0x0000000000200df8 0x000250 0x000258 RW 0x200000 DYNAMIC 0x000e08 0x0000000000200e08 0x0000000000200e08 0x0001d0 0x0001d0

Why does loading the libc shared library have “‘LibraryLoader’ object is not callable” error?

From https://en.wikipedia.org/wiki/Foreign_function_interface the ctypes module can load C functions from shared libraries/DLLs on-the-fly and translate simple data types automatically between Python and C semantics as follows: On Lubuntu 18.04 I was wondering why loading the libc shared library has “‘LibraryLoader’ object is not callable” error? See also https://unix.stackexchange.com/questions/449107/what-differences-and-relations-are-between-the-various-libc-so Answer You’re confusing lower case cdll (which is a LibraryLoader) with upper

How can a shared library know where it resides?

I’m developing a shared library for linux machines, which is dynamically loaded relative to the main executable with rpath. Now, the library itself tries to load other libraries dynamically relative to its location but without rpath (I use scandir to search for shared libraries in a certain folder – I don’t know their names yet). This works only, if the

How does elf-loader knows the address of stderr and stdout

I am disassembling a very simple ELF program (Linux x86). With IDA PRO software I see stdout and stderr in .bss-section. And I haven’t found anything that sets the values of stdout or stderr. How does it work? Сan stdout and stderr be null? Answer So you mean stdout and stderr should always be at the same memory address in

Advertisement