> On Jan 8, 2024, at 13:04, Linus Torvalds wrote:
> 
> On Mon, 8 Jan 2024 at 12:18, Dirk Hohndel via subsurface
> <subsurface@subsurface-divelog.org> wrote:
> 
> "objdump -d" is horrible at disassembly.

no kidding.

> For some unfathomable reason, it doesn't look at relocation
> information, so when it disassembles any instruction with relocations,
> the end result is garbage.
> 
> And no, adding "-r" to make it show relocation information isn't much
> better. The disassembly is still garbage, but there will now be an
> extra line that basically says "if I wasn't showing you garbage, I
> would use this line to tell you what the garbage should have been".
> 
> So then you can - manually - use that relocation information to show
> what the disassembly should have been.

see below

> is the call chain result from here:
> 
>   8   Subsurface-mobile              0x000000010027589c
> QMLManager::~QMLManager() + 68 (qmlmanager.cpp:608)
> 
> but that's really just the return point from that
> 
>>    5d78: 94000000     bl 0x5d78 <QMLManager::~QMLManager()+0x40>
> 
> and that's very much an example of the whole "objdump is showing
> garbage". That function isn't calling itself, but that's what objdump
> -d shows, because it doesn't look at the reloc info.
> 
> Anyway, I think this has probably been compiled with some sanitizer.
> With "-r" to objdump, at least we'd see what the call target for that
> "bl" instruction is, which might give some clue.

    5d60: 34000068      cbz     w8, 0x5d6c <QMLManager::~QMLManager()+0x34>
    5d64: 9103e260      add     x0, x19, #248
    5d68: 94000000      bl      0x5d68 <QMLManager::~QMLManager()+0x30>
                0000000000005d68:  ARM64_RELOC_BRANCH26 
__ZN11QFileDevice5closeEv
    5d6c: 90000008      adrp    x8, 0x5000 <QMLManager::~QMLManager()+0x34>
                0000000000005d6c:  ARM64_RELOC_PAGE21   
__ZN10QMLManager10m_instanceE
    5d70: f900011f      str     xzr, [x8]
                0000000000005d70:  ARM64_RELOC_PAGEOFF12        
__ZN10QMLManager10m_instanceE
    5d74: 91044260      add     x0, x19, #272
    5d78: 94000000      bl      0x5d78 <QMLManager::~QMLManager()+0x40>
                0000000000005d78:  ARM64_RELOC_BRANCH26 __ZN8IosShareD1Ev
    5d7c: 9103e260      add     x0, x19, #248
    5d80: 94000000      bl      0x5d80 <QMLManager::~QMLManager()+0x48>
                0000000000005d80:  ARM64_RELOC_BRANCH26 __ZN5QFileD1Ev
 
_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to