Skip to content
  • Alexey Brodkin's avatar
    arc: introduce "mdbtrick" target · 4c8c485a
    Alexey Brodkin authored
    MetaWare debugger (MDB) is still used as a primary tool for interaction
    with target via JTAG. Moreover some very advanced features are not yet
    implemented in GDB for ARC (and not sure if they will be implemnted
    sometime soon given complexity and rare need for those features for
    common user).
    
    So if we're talking about development process when U-Boot is loaded in
    target memory not by low-level boot-loader but manually through JTAG
    chances are high developer uses MDB for it.
    
    But MDB doesn't support PIE (position-independent executable) - it will
    refuse to even start - that means no chance to load elf contents on
    target.
    Then the only way to load U-Boot in MDB is to fake it by:
      1. Reset PIE flag in ELF header
         This is simpe - on attempt to open elf MDB checks header and if it
    doesn't match its expectation refuces to use provided elf.
      2. Strip all debug information from elf
         If (1) is done then MDB will open elf but on parsing of elf's debug
    info it will refuse to...
    4c8c485a