[GHC] #8238: Implement unloading of shared libraries

GHC ghc-devs at haskell.org
Fri Sep 6 10:29:32 CEST 2013


#8238: Implement unloading of shared libraries
------------------------------------+-------------------------------------
       Reporter:  simonmar          |             Owner:
           Type:  task              |            Status:  new
       Priority:  normal            |         Milestone:  7.10.1
      Component:  Runtime System    |           Version:  7.7
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:  8039              |
------------------------------------+-------------------------------------
 In #8039 we added support for unloading static objects from the runtime
 linker, with the GC detecting when there are no references left.  We could
 add this functionality for shared libraries too, using `dl_iterate_phdr`.

 @heisenbug's comment from #8039 with the relevant pointers:

 [http://eli.thegreenplace.net/2011/08/25/load-time-relocation-of-shared-
 libraries Eli Bendersky's article] suggests to use the
 [http://linux.die.net/man/3/dl_iterate_phdr dl_iterate_phdr] function for
 finding information about loaded libraries. Seems to be linux only. There
 is a [http://stackoverflow.com/questions/10009043/dl-iterate-phdr-
 equivalent-on-mac workaround on OSX], though, on !StackOverflow.

 And here is how Böhm-Demers-Weiser's GC implement a
 [https://github.com/ivmai/bdwgc/blob/master/dyn_load.c#L451 callback
 function for dl_iterate_phdr].

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8238>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler




More information about the ghc-tickets mailing list