source: rtems-tools/linkers/rld-resolver.h @ 17c8364

4.104.115
Last change on this file since 17c8364 was 544de91, checked in by Chris Johns <chrisj@…>, on 12/28/12 at 23:20:22

Fix managing weak symbols.

Weak symbols where not being managed correctly. The symbols table
is now a class with externals and weaks as separate symtabs so
the externals can be searched first then the weaks and if not
found an unresolved error is raised. This was found creating
a libbsdport RAP file where the drivers in the all driver table
resolved to the weak symbols and so linking in nothing.

Fixing the weak symbols as found in the libbsdport library
triggered a new resolver bug. The object files now contain the
resolver state and this is used to determine if an object file
has been resolved or is currently being resolved avoiding
rescursive loops with dependent object files.

The resolver trace output is a little easier to read.

  • Property mode set to 100644
File size: 1.7 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 resolver determines which object files are needed.
22 *
23 */
24
25#if !defined (_RLD_RESOLVER_H_)
26#define _RLD_RESOLVER_H_
27
28#include <rld-files.h>
29#include <rld-symbols.h>
30
31namespace rld
32{
33  namespace resolver
34  {
35    /**
36     * Resolve the dependences between object files.
37     *
38     * @param dependents The object modules dependent on the object files we
39     *                   are linking.
40     * @param cache The file cache.
41     * @param base_symbols The base image symbol table
42     * @param symbols The object file and library symbols
43     * @param undefined Extra undefined symbols dependent object files are
44     *                  added for.
45     */
46    void resolve (files::object_list& dependents,
47                  files::cache&       cache,
48                  symbols::table&     base_symbols,
49                  symbols::table&     symbols,
50                  symbols::symtab&    undefined);
51  }
52}
53
54#endif
Note: See TracBrowser for help on using the repository browser.