source: rtems-tools/linkers/rld-outputter.h @ c1d1636

4.104.115
Last change on this file since c1d1636 was eb34811, checked in by Chris Johns <chrisj@…>, on 11/21/12 at 00:07:12

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.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 * Copyright (c) 2011, Chris Johns <chrisj@rtems.org>
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16/**
17 * @file
18 *
19 * @ingroup rtems-ld
20 *
21 * @brief RTEMS Linker outputter handles the various output formats.
22 *
23 */
24
25#if !defined (_RLD_OUTPUTTER_H_)
26#define _RLD_OUTPUTTER_H_
27
28#include <rld-files.h>
29
30namespace rld
31{
32  namespace outputter
33  {
34    /**
35     * The types of output.
36     */
37    enum type
38    {
39      ot_script,
40      ot_archive,
41      ot_application
42    };
43
44    /**
45     * Output the object file list as a string.
46     *
47     * @param dependents The list of dependent object files
48     * @param cache The file cache for the link. Includes the object list
49     *              the user requested.
50     * @return std::string The list as a text string.
51     */
52    std::string script_text (rld::files::object_list& dependents,
53                             rld::files::cache&       cache);
54    /**
55     * Output the object files as an archive format file with the metadata as
56     * the first ELF file.
57     *
58     * @param name The name of the archive.
59     * @param dependents The list of dependent object files
60     * @param cache The file cache for the link. Includes the object list
61     *              the user requested.
62     */
63    void archive (const std::string&       name,
64                  rld::files::object_list& dependents,
65                  rld::files::cache&       cache);
66
67    /**
68     * Output the object file list as a script.
69     *
70     * @param name The name of the script.
71     * @param dependents The list of dependent object files
72     * @param cache The file cache for the link. Includes the object list
73     *              the user requested.
74     */
75    void script (const std::string&       name,
76                 rld::files::object_list& dependents,
77                 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
91  }
92}
93
94#endif
Note: See TracBrowser for help on using the repository browser.