How to disassemble a binary executable in yacto linux to get the assembly code?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to disassemble a binary executable in yacto linux to get the assembly code?

Jump to solution
15,547 Views
vinothkumars
Senior Contributor IV

Hi All,

I am using yacto with T4240 target and I built the u-boot.bin file. I want to check instruction.

Please provide command or path to generate assembly code from yacto linux executable binary.

SDK,

   QorIQ-SDK-V2.0-20160527-yocto

Regards,

VinothS

Regards,
Vinothkumar Sekar
0 Kudos
1 Solution
1,733 Views
vinothkumars
Senior Contributor IV

Hi,

I done 

<Yacto SDK installation directory>/build_t4240rdb-64b/tmp/sysroots/x86_64-linux/usr/bin/powerpc64-fsl-linux/powerpc64-fsl-linux-objdump -d u-boot-spl > u-boot-spl1.dis

u-boot-spl1.dis,

u-boot-spl: file format elf32-powerpc


Disassembly of section .text:

eff40000 <_start>:
eff40000: 27 05 19 56 dozi r24,r5,6486

eff40004 <version_string>:
eff40004: 55 2d 42 6f rlwinm. r13,r9,8,9,23

...................................................................

Regards,

VInothS

Regards,
Vinothkumar Sekar

View solution in original post

6 Replies
1,733 Views
Pavel
NXP Employee
NXP Employee

It looks like that this BSP does not supports this possibilities.

 

The simplest way for your task is CodeWarrior. CodeWarrior provides u-boot debugging and check instruction.

See the AN4876 application note:

https://www.nxp.com/docs/en/application-note/AN4876.pdf

Have a great day,
Pavel Chubakov

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,734 Views
vinothkumars
Senior Contributor IV

Hi,

I done 

<Yacto SDK installation directory>/build_t4240rdb-64b/tmp/sysroots/x86_64-linux/usr/bin/powerpc64-fsl-linux/powerpc64-fsl-linux-objdump -d u-boot-spl > u-boot-spl1.dis

u-boot-spl1.dis,

u-boot-spl: file format elf32-powerpc


Disassembly of section .text:

eff40000 <_start>:
eff40000: 27 05 19 56 dozi r24,r5,6486

eff40004 <version_string>:
eff40004: 55 2d 42 6f rlwinm. r13,r9,8,9,23

...................................................................

Regards,

VInothS

Regards,
Vinothkumar Sekar
1,733 Views
Pavel
NXP Employee
NXP Employee

Yocto SDK provides generation u-boot source code. Disassembling is not needed for debugging.

Have a great day,
Pavel Chubakov

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,733 Views
vinothkumars
Senior Contributor IV

Hi Pavel,

In SDK after done built we got tool for binutils,

binutils includes objdump and libopcodes library for assembly code generation. 

By using this tool we can generate the assembly code for yacto linux executable. But, I don't know how to processed this and also I tried nothing I got.

<SDK installation directory>/build_t4160qds-64b/tmp/sysroots/t4160qds-64b/pkgdata/runtime-reverse u-boot-spl > u-boot-spl1.dis

Regards,

VinothS

Regards,
Vinothkumar Sekar
0 Kudos
1,733 Views
Pavel
NXP Employee
NXP Employee

Usually the following command is used for u-boot code modification:

bitbake -c cleansstate u-boot

bitbake -c patch u-boot

This command generates source of the u-boot. See u-boot source using the similar path:

QorIQ-SDK-V2.0-20160527-yocto/build_t1042d4rdb/tmp/work/t1042d4rdb-fsl-linux/u-boot-qoriq/2016.01+fslgit-r0/git

 

Change u-boot code and use the following command for u-boot building:

bitbake -c compile -f u-boot

bitbake u-boot

Have a great day,
Pavel Chubakov

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,733 Views
vinothkumars
Senior Contributor IV

Hi Pavel,

Thank you for your reply.

Whatever you mentioned commands are the general for building/compiling purpose.

After compilation we got linux executable binary file by using this file we can generate disassembly code file for u-boot debugging.

For this purpose. there is specific tool under the yacto sdk.

Regards,

VinothS

Regards,
Vinothkumar Sekar
0 Kudos