[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.

    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:

    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: https://www.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: https://www.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: https://www.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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!