Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-22 Thread Lev Olshvang
Boker tov, Thanks for all of your replies that helped me to understand what question I really wanted to ask. So this is a question. I have  C++ program which calls many services of third party library.This library is needed only on initialization phase of my program.  Linker has resolved symbols of this library and now it is bound to executable and in a run tinethis lib will be mapped  will have use count > 0   while executable is in use.I would like to unmap it to release memory, but i do not know how to do it in user space. As an alternative I know that by using dynamic loader calls  dlopen() .. dlclose()  I can achieve the desired effect The problem that I need to add a lot of dlfind() calls, and I looked for a way dynamic loader can do it.I am not that lazy, but since the code is C++,  function names are mangled and I was tring to avoid thisby looking as a subject of this mail said, way to ask kernel to unmap this lib I wish we have __init attribute in a user land ! Many Many Thanks again, Lev.  21.12.2018, 20:18, "Shachar Shemesh" :
  


  
  
On 21/12/2018 16:20, Lev Olshvang
  wrote:


  Hi All,

I have  an executable (C++) which is the exclusive user of the some shared library that it uses only during  the initialization phase.

I would like to free memory used by this shared library, because I am running on embedded system.

How can I achieve this?

I know that dlopen() will load shared library, and hope that following dlclose() will free this lib memory. 

1. Still  I do not know what method should be used to make dynamic linker look again into executable and resolve symbols of the newly appeared symbols ?
2. And  how to tell the dynamic linker ld-linux.so to postpone the symbol resolution until dlopen()  will load  the library?
3. Whether to compile and link executable with this library or leave unresolved symbols?

What you are asking for, as asked, is not possible. If you
  explain your use case better, we might better understand what
  you're trying to do.


With that said, I think you should just link the library.


All the text segments of the library (i.e. - code) will be loaded
  with a read only shared mapping. This means that if they are not
  used, they will be unmapped the first time memory becomes
  constrained. If you do not use them later on, they will simply not
  be loaded to memory. They will still be mapped, but will not load
  your embedded system's memory in any significant way.


Shachar


  


,___Linux-il mailing listLinux-il@cs.huji.ac.ilhttp://mailman.cs.huji.ac.il/mailman/listinfo/linux-il___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Hebrew on virtual consoles

2018-12-22 Thread Boruch Baum
I wanted to propose an update to the Linux Hebrew HOW-TO that exists
here[1], and supposedly also here[2]; however, my attempt to contact the
maintainer listed there has failed.

Although that documentation is quite old, it still is the principal
English-language guide on the subject, so if my proposals have merit,
there should be some way to amend the document. Is anyone on this list
able to contact the author?

What I wanted to address in that document was to update how it directs
users to configure Hebrew for virtual consoles (ie. not within X11) in
order to account for modern unicode fonts.

I'm experimenting now, using debian 9, and I find:

a) /usr/share/consolefonts includes some unicode fonts that
   include Hebrew (eg. setfont Uni1-{foo}), but most don't seem to.

b) /usr/share/consolefonts doesn't include the Joel Hoffman font
   mentioned in the HOWTO, but it does include several non-unicode
   Hebrew-* ones (eg. setfont Hebrew-VGA14).

c) For proper unicode support, there now exist commands 'unicode_start'
   and 'unicode_stop'. The command 'kbd_mode' will tell you if you're in
   unicode mode.

d) For people who have defined more than two keyboard layouts in
   /etc/default/keyboard, the toggling amongst them within a virtual
   console operates differently than it does within an X11 virtual
   terminal. The toggling sequence is layout-1, layout-2, layout-1,
   layout-3, ... layout-1, layout-n.

references:
---
[1] http://wiki.tldp.org/Hebrew-HOWTO
[2] http://shekel.jct.ac.il/~rajwan/Hebrew.html

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il