[SOLVED] Not expected behaviour when opening ELF file with Ozone

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Not expected behaviour when opening ELF file with Ozone

    Hi there,

    I have an ELF file of the u-boot bootloader, that I'd like to debug.

    Source Code

    1. aarch64-poky-linux-readelf -h u-boot
    2. ELF Header:
    3. Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
    4. Class: ELF64
    5. Data: 2's complement, little endian
    6. Version: 1 (current)
    7. OS/ABI: UNIX - System V
    8. ABI Version: 0
    9. Type: EXEC (Executable file)
    10. Machine: AArch64
    11. Version: 0x1
    12. Entry point address: 0x40200000
    13. Start of program headers: 64 (bytes into file)
    14. Start of section headers: 5552136 (bytes into file)
    15. Flags: 0x0
    16. Size of this header: 64 (bytes)
    17. Size of program headers: 56 (bytes)
    18. Number of program headers: 2
    19. Size of section headers: 64 (bytes)
    20. Number of section headers: 27
    21. Section header string table index: 26
    Display All


    Compiled by aarch64-poky-linux-gcc (GCC) 11.2.0.

    When I open it with the Ozone, it prints the following in the console, no errors are seen there, but shows content of the file as an editor that opened a binary file, not the source code expected:

    Source Code

    1. Disabled output of control characters
    2. SEGGER Ozone - The J-Link Debugger V3.38d
    3. J-Link software found at: /opt/SEGGER/Ozone_V338d/Lib/libjlinkarm.so
    4. File.NewProject();
    5. File.NewProject();
    6. File.NewProjectWizard();
    7. Target core support plugin loaded.: /opt/SEGGER/Ozone_V338d/Plugins/Core/CorePluginARM.so
    8. Project.SetDevice ("MIMX8MQ5_A53_0");
    9. Project.SetHostIF ("USB", "");
    10. Project.SetTargetIF ("JTAG");
    11. Project.SetTIFSpeed ("4 MHz");
    12. Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-A53_AArch64.svd");
    13. File path resolved: "$(InstallDir)/Config/CPU/Cortex-A53_AArch64.svd" was found at "/opt/SEGGER/Ozone_V338d/Config/CPU/Cortex-A53_AArch64.svd"
    14. File.Open ("/tmp/u-boot");
    Display All
    What did I miss? ?(


    Thank you for your help

    Cheers,
    Andy
  • Hi andypandy,
    in general loading an ELF file should work as you expect it. According to the given information the ELF file should be digestible by Ozone. You may check if changing the file extension to ".elf" does have a positive effect. If not, could you please share your ELF file with us for further analysis?
    Best regards
    -- AlexD
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi andypandy,

    thank you for the flowers and good to see you are up and running again.

    Actually, Ozone should be able to cope with ELF files not coming with a file name extension. In that case ELF file detection is supposed to operate on the ELF file header information, which, according to your initial post, appears to be OK. So if you could provide your ELF file we could check if we can reproduce your observation.

    Best regards
    -- AlexD
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi AlexD,

    I spent some time to find out what might have caused the issue.

    My findings:

    If there is the dot in the directory name (in my case it was 2021.04-r0) in the path leading to the elf file (.) it opens it as a binary file unless .elf extension is present.
    So, if you put the u-boot to /tmp/1.1/ directory it will open it as binary, if you put there u-boot.elf it will open it as ELF, on the other hand if you copy the u-boot to /tmp/1/ it will open it as ELF.

    I hope it helps, it doesn't seem to depend on the content as much as the directory names, and the elf file name.

    P.S. I am running the Ozone in Linux

    Cheers,
    Andy
  • Hi Andy,
    thanks for the details. Might well be that Ozone gets a hick-up when handling file names as you did. We will check if we can reproduce that locally. Stay tuned, we will report back.
    Best regards
    -- AlexD
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Andy,

    quick update: We were able to reproduce the issue.
    We will of course have a closer look and provide a fix in a future Ozone release.

    Thank you for making us aware of this!

    Kind regards,
    SebastianB
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.