On Mon, 8 Jan 2024 at 12:18, Dirk Hohndel via subsurface
<[email protected]> wrote:
>
On Jan 8, 2024, at 11:15, Berthold Stoeger wrote:
> >
> > If all else fails, you could disassemble qmlmanager.ccc.o. as such:
> >
> > objdump -d 
> > ./mobile-widgets/CMakeFiles/subsurface_mobile.dir/qmlmanager.cpp.o\

"objdump -d" is horrible at disassembly.

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.

> That's what I did.
>
> Sorry for the LONG email :)
>
> 0000000000005d38 <QMLManager::~QMLManager()>:
>     5d38: a9bd57f6     stp x22, x21, [sp, #-48]!
>     5d3c: a9014ff4     stp x20, x19, [sp, #16]
>     5d40: a9027bfd     stp x29, x30, [sp, #32]
>     5d44: 910083fd     add x29, sp, #32
>     5d48: aa0003f3     mov x19, x0
>     5d4c: 90000008     adrp x8, 0x5000 <QMLManager::~QMLManager()+0x14>
>     5d50: f9400108     ldr x8, [x8]
>     5d54: 91004108     add x8, x8, #16
>     5d58: f9000008     str x8, [x0]
>     5d5c: 39442008     ldrb w8, [x0, #264]
>     5d60: 34000068     cbz w8, 0x5d6c <QMLManager::~QMLManager()+0x34>
>     5d64: 9103e260     add x0, x19, #248
>     5d68: 94000000     bl 0x5d68 <QMLManager::~QMLManager()+0x30>
>     5d6c: 90000008     adrp x8, 0x5000 <QMLManager::~QMLManager()+0x34>
>     5d70: f900011f     str xzr, [x8]
>     5d74: 91044260     add x0, x19, #272
>     5d78: 94000000     bl 0x5d78 <QMLManager::~QMLManager()+0x40>
>     5d7c: 9103e260     add x0, x19, #248
>     5d80: 94000000     bl 0x5d80 <QMLManager::~QMLManager()+0x48>
>     5d84: f9407a60     ldr x0, [x19, #240]
>     5d88: b9400008     ldr w8, [x0]


Well, that

 >     5d7c: 9103e260     add x0, x19, #248

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.

               Linus
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to