Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/cfbf0eb134efd1c5d9a589f6ae2139d7fad60581

>---------------------------------------------------------------

commit cfbf0eb134efd1c5d9a589f6ae2139d7fad60581
Author: Duncan Coutts <[email protected]>
Date:   Thu May 12 16:25:41 2011 +0100

    Make the GHCi linker handle partially stripped object files (#5004)
    
    When you use 'strip --strip-unneeded' on a ELF format .o or .a file, if
    the object file has no global/exported symbols then 'strip' ends up
    removing the symbol table entirely. Previously the GHCi linker assumed
    there would always be exactly one symbol table and exactly one string
    table. In fact, in ELF object files there is no such limitation, instead
    each section points to the other sections it needs, in particular
    relocation sections have a link to the symbol table section they use and
    symbol table sections have a link to the corresponding string table.
    So instead of assuming there will always be a global symbol and string
    table, all we have to do is validate and follow these links. Then, when
    we encounter an empty object file that has no symbols then we handle it
    correctly, because since it's empty we never process any relocations and
    so never have to follow any links to non-existant symbol tables.
    
    Also, in the case where an object is fully stripped, we can now detect
    this more reliably and emit a more helpful error message, e.g:
    
    libHSghc-7.1.20110509.a(DsMeta.o): relocation section #2 has no symbol table
    This object file has probably been fully striped. Such files cannot be 
linked.

 rts/Linker.c |  163 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 89 insertions(+), 74 deletions(-)


Diff suppressed because of size. To see it, use:

    git show cfbf0eb134efd1c5d9a589f6ae2139d7fad60581

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to