Skip to content
  • Howard B. Golden's avatar
    FIX #2615 (linker scripts in .so files) · 25414b79
    Howard B. Golden authored
    This is the regression test for FIX #2615 (linker scripts in .so files).
    
    It does NOT apply to Windows. It applies only to systems using ELF files.
    
    In order for this test to work on all ELF systems, no assumption is
    made about whether or not real ELF shared libraries and linker scripts
    exist. Instead, this patch compiles a trivial C program into an ELF shared
    library. Also, a mock linker script (libfoo_script_T2615.so) is included in
    the patch. Note: This is marked as a binary, but it is a text file.
    
    Test approach:
    
    A small Haskell program (T2615.hs) imports the ObjLink module from GHC.
    It then calls the loadDLL function with the name of the mock linker script
    (libfoo_script_T2615.so). This mock script contains a link to a real
    shared library (libfoo_T2615.so) which the test has already created. If
    the dlopen (in the addDLL function in rts/Linker.c) works, the Haskell
    program will return a success message. Otherwise, it will return the error
    message it receives from loadDLL (which is actually the dlerror() message
    received by addDLL).
    25414b79