Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 17 Oct 2003 04:44 PM by  Anonymous
ARM-elf or Greenhill-elf downloads
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
hansr@logicpd.com
New Member
New Member
Posts:


--
04 Jun 2003 04:02 PM
    How do I get elf files generated by ARM or Greenhill tools to download to the 79520 development kit?
    miket@logicpd.com
    New Member
    New Member
    Posts:


    --
    05 Jun 2003 10:01 AM
    The ELF loader needs to know the address in memory where it should
    place the incoming binary file. The Greenhill and ARM tools place this
    information at the very end of an ELF file. When downloading over a
    non-random access device, such as a serial port, it is impossible to
    access this information until the entire file has been transferred, at which
    point it is impossible to rewind the binary stream to access the file's
    contents. The solutions to this problem are one of the following:

    option 1: Load the file off of a random access device, such as a Compact
    Flash card (which is currently the only random access device we support).

    option 2: Move the "elf program header" to the beginning of the file.

    One way to do this is to use the GNU binutils (arm-elf) package to recreate the
    binary image with the elf headers at the -front- of the file. for example:

    arm-elf-objcopy -O binary ELF_FILE_FROM_GREEENHILL.elf temporary_file.raw
    arm-elf-ld -s -o REFORMATTED_ELF.elf -b binary temporary_file.raw -Tdata 0x40000 -Ttext0x40000

    Where the arguments to the -Tdata and -Ttext parameters tell the linker
    how to setup the headers of the newly created file. These values can be found
    in the output of

    arm-elf-objdump -x ELF_FILE_FROM_GREENHILL.elf


    mt
    Anonymous
    Posts:


    --
    08 Sep 2003 03:46 PM
    here's a better description of what's going on...

    The first step of the process removes all metadata from the file, including load addresses, all section information, any sections not marked LOAD or ALLOC, start address info, etc... What remains is a bare binary file containing what would have been loaded into memory, basically a memory image.

    The second step takes that binary memory image and slaps on an elf header -- at the /beginning/ of the file so that the serial loader can load it. It just creates a new elf file with a huge data section whose contents are the loadable portion (including executable code) of the old elf file. The parameters for Tdata and Ttext tell the linker where to put this section in the new elf file, and where the start address should be, respectively.

    So, if the old elf file's first loadable section (marked LOAD or ALLOC) was at 0x200c0000 and the start address was at 0x200c0000, then the parameters for Tdata and Ttext would be 0x200c0000 and Tdata would also be 0x200c0000.

    See the binutils manuals at http://sources.redhat.com/binutils/docs-2.12/ for more information.

    mt
    mdobbles@dexcom.com
    New Member
    New Member
    Posts:


    --
    16 Oct 2003 01:14 PM
    Where do I get the arm-elf-objcopy tools?
    Anonymous
    Posts:


    --
    17 Oct 2003 04:44 PM
    Hello,

    The arm-elf-objcopy tools are part of the standard GNU binutils package. They are included on the Zoom Starter CD that ships with each kit. They are also available from sources.redhat.com/binutils.

    Regards,
    Andrew Wawra
    Logic Product Development
    You are not authorized to post a reply.