Skip to content

Split up -Dl debug flag

Currently the runtime system offers the -Dl flag for debugging linking issues. However, this produces an absolute torrent of output, much of which isn't useful for debugging simple problems. We should split this up into multiple flags. For instance:

  • -Dl produces minimal linkage information (e.g. paths searched, when objects are loaded and unloaded)
  • -Dla produces more information regarding address space layout (useful for debugging low-memory fragmentation, for instance)
  • -Dlr produces verbose relocation information (useful for debugging bugs in the relocation handling logic)

There is an argument to be made that -Dl should even be available in the non-debug RTS, although that will require a bit more refactoring.

File name function category
Linker.c ghciLookupSymbolInfo
Linker.c initLinker_
Linker.c internal_dlopen
Linker.c internal_dlsym
Linker.c addDLL
Linker.c findSystemLibrary
Linker.c addLibrarySearchPath
Linker.c removeLibrarySearchPath
Linker.c lookupDependentSymbol
Linker.c loadSymbol
Linker.c lookupSymbol
Linker.c mmapForLinker
Linker.c mmapForLinkerMarkExecutable
Linker.c mkOc
Linker.c preloadObjectFile
Linker.c loadObj_
Linker.c loadOc
Linker.c ocTryLoad
Linker.c resolveObjs_
Linker.c unloadObj_
Linker.c addProddableBlock
Linker.c addSection
Linker.c unloadNativeObj
Linker.c freeSegments
Elf.c ocVerifyImage_ELF
Elf.c ocGetNames_ELF
Elf.c do_Elf_Rel_relocations relocation
Elf.c do_Elf_Rela_relocations relocation
Elf.c loadNativeObj_ELF
Elf.c ocAllocateExtras_ELF
LoadArchive.c loadFatArchive
LoadArchive.c loadArchive_
MachO.c ocAllocateExtras_MachO
MachO.c ocVerifyImage_MachO
MachO.c resolveImports
MachO.c relocateSection relocation
MachO.c ocBuildSegments_MachO
MachO.c ocGetNames_MachO
MachO.c ocResolve_MachO
MachO.c ocRunInit_MachO
MachO.c machoGetMisalignment
PEi386.c addDLLHandle
PEi386.c addDLL_PEi386
PEi386.c addLibrarySearchPath_PEi386
PEi386.c checkAndLoadImportLibrary
PEi386.c lookupSymbolInDLLs
PEi386.c ocVerifyImage_PEi386
PEi386.c ocGetNames_PEi386
PEi386.c ocResolve_PEi386
PEi386.c lookupSymbol_PEi386
Edited by Alex D
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information