Changeset eb34811 in rtems-tools


Ignore:
Timestamp:
Nov 21, 2012, 12:07:12 AM (7 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, master
Children:
c1d1636
Parents:
a1d4930
Message:

Output application format files.

Added support for an RTEMS RAP format application file. The format is:

<header>
<LZ77>

<Application Script>
<[1..n] ELF Object files>

</LZ77>

Where the header is a text string of fields delimited by ',' and terminated
with a line feed (\n). It is variable length:

RTEMS-APP,0000000,01.00.00,LZ77,00000000\n\0

where:

RTEMS-APP : file tag for quick acceptance and rejection
Length : the length of the application in bytes including the

: header

Version : Version of the application format.
Compress : The compression format.
Checksum : CCITT CRC32 checksum.

Following the header is a nul ('\0') character then an LZ77 container
with the application loader script followed by the ELF object files.

Note, the script format will be documented else where.

Note, the final version may add a 32bit length field before each part
in the compressed container to delimit the size of the file to be
read. This is currently not in this version.

Location:
linkers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • linkers/rld-outputter.h

    ra1d4930 reb34811  
    3333  {
    3434    /**
     35     * The types of output.
     36     */
     37    enum type
     38    {
     39      ot_script,
     40      ot_archive,
     41      ot_application
     42    };
     43
     44    /**
    3545     * Output the object file list as a string.
    3646     *
     
    4353                             rld::files::cache&       cache);
    4454    /**
    45      * Output the object file list as a script.
     55     * Output the object files as an archive format file with the metadata as
     56     * the first ELF file.
    4657     *
    4758     * @param name The name of the archive.
     
    6576                 rld::files::object_list& dependents,
    6677                 rld::files::cache&       cache);
     78
     79    /**
     80     * Output the object files as a compressed list of files.
     81     *
     82     * @param name The name of the script.
     83     * @param dependents The list of dependent object files
     84     * @param cache The file cache for the link. Includes the object list
     85     *              the user requested.
     86     */
     87    void application (const std::string&  name,
     88                      files::object_list& dependents,
     89                      files::cache&       cache);
     90
    6791  }
    6892}
  • linkers/rtems-ld.cpp

    ra1d4930 reb34811  
    171171    std::string          base_name;
    172172    std::string          cc_name;
    173     bool                 script = false;
     173    rld::outputter::type output_type = rld::outputter::ot_application;
    174174    bool                 standard_libs = true;
    175175    bool                 exec_prefix_set = false;
     
    212212
    213213        case 'S':
    214           script = true;
     214          output_type = rld::outputter::ot_script;
    215215          break;
    216216
     
    386386       * Output the file.
    387387       */
    388       if (script)
    389         rld::outputter::script (output, dependents, cache);
    390       else
    391         rld::outputter::archive (output, dependents, cache);
     388      switch (output_type)
     389      {
     390        case rld::outputter::ot_script:
     391          rld::outputter::script (output, dependents, cache);
     392          break;
     393        case rld::outputter::ot_archive:
     394          rld::outputter::archive (output, dependents, cache);
     395          break;
     396        case rld::outputter::ot_application:
     397          rld::outputter::application (output, dependents, cache);
     398          break;
     399        default:
     400          throw rld::error ("invalid output type", "output");
     401      }
    392402
    393403      /**
Note: See TracChangeset for help on using the changeset viewer.