#3333: GHCi doesn't load weak symbols
-----------------------------------+----------------------------------------
 Reporter:  heatsink               |          Owner:        
     Type:  bug                    |         Status:  new   
 Priority:  normal                 |      Milestone:        
Component:  GHCi                   |        Version:  6.10.3
 Severity:  normal                 |     Resolution:        
 Keywords:  weak, dynamic loading  |       Testcase:        
       Os:  Linux                  |   Architecture:  x86   
-----------------------------------+----------------------------------------
Comment (by heatsink):

 I investigated the linking rules for weak symbols in ELF,
 http://www.skyfree.org/linux/references/ELF_Format.pdf .  If I understand
 correctly, the linking precedence is:

 global undefined < weak undefined < weak defined < global defined

 The highest-precedence symbol is used for relocation.  If it's "weak
 undefined", then the symbol gets an absolute address of NULL.  If "weak
 defined", an arbitrary definition of the symbol is chosen.  This should be
 do-able when loading a batch of object files.

 Because libraries get loaded incrementally, not all situations can be
 handled properly.  If a previously loaded weak symbol would get "promoted"
 to a higher precedence, GHCi will have to abort, as it currently does for
 conflicting global definitions.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3333#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to