Skip to content

dwarf dump fails on ProDG compiled PSP ELF (Failed: Unhandled .debug relocation type Absolute) #118

Description

@RibShark

While I know DTK is mostly aimed at GameCube/Wii, I have found it incredibly useful for parsing out DWARF1 symbols into a human readable format on ELFs for other systems, as no other tool seems capable of this.

Pac-Man Rally (Europe) (En,Fr,De,Es,It) (Proto) (2007-05-01) contains an unstripped ELF with DWARF1 symbols with the name PMR_PSPwSYM.prx (despite the extension this is in fact an ELF and not a PRX), however when I try and parse the symbols with DTK I get the error Failed: Unhandled .debug relocation type Absolute. The game is compiled with ProDG which is where I assume the problem lies as it's not the usual compiler even for PSP, and has some quirks.

Activity

  1. Mc-muffin commented on Nov 19, 2025

    @Mc-muffin

    ProDG for PSP uses DWARFv2 as its debug info format, by extension the game you mention also has DWARFv2 debug info, which is out of the scope of dtk's dwarf dump.

    EDIT: Okay nvm, seems like it has both kinds of debug info DWARFv2 from GCC and DWARFv1 from SNC, I was too quick to say that after seeing the DWARFv2 debug sections.

  2. Mc-muffin commented on Nov 19, 2025

    @Mc-muffin

    After that derp moment I decided to take a look, main changes seem to be:

    • dtk doesn't apply any MIPS relocs when loading the debug section, adding elf::R_MIPS_32 to this line allows it to continue past the relocation error (but it's likely the wrong solution)
    • SN added DWARFv2's DW_FORM_strp to all DW_AT_name attributes, instead of an inline string they are a pointer into .debug_str
    • They use DW_TAG_pointer_type for pointers, the tag just has a single DW_AT_user_def_type with a REF to the pointed-to type
    • New fundamental type, 0xF201, which maps to bool (size 1 byte) according to the demangler

    That seems to be all the stuff missing from dtk that blocks it from working with the mentioned game, I hit the codebase (and my head) with a hammer until it could produce this PMR_PSPwSYM.txt which looks correct-ish (ignoring the horribly wrong range and addresses)

  3. Mc-muffin commented on Nov 20, 2025

    @Mc-muffin

    Small addendum, the only SN compiler version available (which is later than the one used in Pacman) has some differences:

    • DW_TAG_typedef and DW_TAG_pointer_type entries apparently have no DW_AT_sibling (no idea why)
    • New tag 0x8100, DW_TAG_SN_namespace seems to only have DW_AT_name and optionally children with the same tag (for nested namespaces), default namespace is ::
    • New attribute 0x8100, DW_AT_SN_namespace_member uses DW_FORM_ref to point to the relevant DW_TAG_SN_namespace entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions