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

4.104.11
Last change on this file since 810d0ad was 810d0ad, checked in by Chris Johns <chrisj@…>, on Oct 23, 2012 at 12:58:34 AM

Fix repeats in output when cmd line objects depend on each other.

If an object on the command line depends on another object the output
code wrote the object files and then the dependent files and a
command line object file that is dependent ended up in the object
and dependent lists. A simple merge and unique fixed it.

Also moved the script generation code into a separate function
that can be used in a application container.

  • Property mode set to 100644
File size: 2.3 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     * Output the object file list as a string.
36     *
37     * @param dependents The list of dependent object files
38     * @param cache The file cache for the link. Includes the object list
39     *              the user requested.
40     * @return std::string The list as a text string.
41     */
42    std::string script_text (rld::files::object_list& dependents,
43                             rld::files::cache&       cache);
44    /**
45     * Output the object file list as a script.
46     *
47     * @param name The name of the archive.
48     * @param dependents The list of dependent object files
49     * @param cache The file cache for the link. Includes the object list
50     *              the user requested.
51     */
52    void archive (const std::string&       name,
53                  rld::files::object_list& dependents,
54                  rld::files::cache&       cache);
55
56    /**
57     * Output the object file list as a script.
58     *
59     * @param name The name of the script.
60     * @param dependents The list of dependent object files
61     * @param cache The file cache for the link. Includes the object list
62     *              the user requested.
63     */
64    void script (const std::string&       name,
65                 rld::files::object_list& dependents,
66                 rld::files::cache&       cache);
67  }
68}
69
70#endif
Note: See TracBrowser for help on using the repository browser.