Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12604 Discussions

Is there a disassembler for Nios II ELF files?

Altera_Forum
Honored Contributor II
2,022 Views

I'd like to be able to examine the ELF file that the compiler generates so I can see exactly which instructions are being used. I have the Nios II Processor reference document which shows the opcodes, but I haven't seen anything about a dissassembler.  

 

Also where can I read about what exactly goes in each section of the ELF file? For instance, what goes in the .exceptions section? From looking at the program headers it seems like this should be executable code but it doesn't look like executable code in a hex editor.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
717 Views

Hi bkucera, 

 

> but I haven't seen anything about a dissassembler. 

 

Use objdump with the -D option. 

 

> Also where can I read about what exactly goes in each section of the ELF file? 

> For instance, what goes in the .exceptions section?  

 

Take a look at your linker command file, use objdump ... and you might want to 

generate a map file as well. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
717 Views

 

--- Quote Start ---  

originally posted by smcnutt@Dec 13 2005, 05:14 PM 

hi bkucera, 

 

take a look at your linker command file, use objdump ... and you might want to 

generate a map file as well. 

--- Quote End ---  

 

 

Great, objdump is what I was looking for. Where is my linker command file, and how do I generate a map file? Thanks!
0 Kudos
Altera_Forum
Honored Contributor II
717 Views

> Where is my linker command file,  

 

Look in your system library path. E.g. for a debug build: 

 

xxx\Debug\system_description\generated.x 

 

> and how do I generate a map file? 

 

Pass the -Map option to the linker: 

 

$ nios2-elf-ld [OTHER OPTIONS] -Map app.map 

 

Use -Wl,-Map -Wl,app.map for gcc. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
717 Views

Hi, 

 

There is another possibility: 

If you are looking for a debugger which directly reads in the ELF file than we can provide a commercial product. This debugger shows besides the opcode and the corresponding disassembled mnemonics also the program flow and cycle count information (per instruction or accumulated over time), and many more features. 

You can download this product from www.adveda.com, you can use it for two weeks (license is time limited). 

 

Regards,
0 Kudos
Altera_Forum
Honored Contributor II
717 Views

Thanks all of you! 

 

It's very kind of you! 

 

I'm from china, and there are few people using NiosII, so I feel alone!:( 

 

Now, I won&#39;t feel alone anymore, because I find my home!:) http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif  

 

Thanks again!
0 Kudos
Reply